RE: [PHP] Paging and permissions

2011-02-09 Thread Arno Kuhl
On Tue, 2011-02-08 at 14:36 +0200, Arno Kuhl wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one

RE: [PHP] Paging and permissions

2011-02-09 Thread Ashley Sheridan
On Wed, 2011-02-09 at 13:03 +0200, Arno Kuhl wrote: On Tue, 2011-02-08 at 14:36 +0200, Arno Kuhl wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in

RE: [PHP] Paging and permissions

2011-02-09 Thread Arno Kuhl
Instead of serializing the articles, you only need their IDs. Using $sql .= ' where id in (' . implode(',', $ids) . ')'; you can load the data for a page of results in a single query. Storing the IDs is much cheaper than the articles. If the permissions are fairly static (i.e. access for

RE: [PHP] Paging and permissions

2011-02-09 Thread Ashley Sheridan
On Wed, 2011-02-09 at 13:27 +0200, Arno Kuhl wrote: Instead of serializing the articles, you only need their IDs. Using $sql .= ' where id in (' . implode(',', $ids) . ')'; you can load the data for a page of results in a single query. Storing the IDs is much cheaper than the

Re: [PHP] Paging and permissions

2011-02-08 Thread David Hutto
On Tue, Feb 8, 2011 at 7:36 AM, Arno Kuhl ak...@telkomsa.net wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per container,

Re: [PHP] Paging and permissions

2011-02-08 Thread Ashley Sheridan
On Tue, 2011-02-08 at 14:36 +0200, Arno Kuhl wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per container, but one or

Re: [PHP] Paging and permissions

2011-02-08 Thread Tolas Anon
On Tue, Feb 8, 2011 at 1:36 PM, Arno Kuhl ak...@telkomsa.net wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per

Re: [PHP] Paging and permissions

2011-02-08 Thread David Harkness
On Tue, Feb 8, 2011 at 4:36 AM, Arno Kuhl ak...@telkomsa.net wrote: But it might be an option if done once at the start of each search or list request, and then use that temporary modified result set for subsequent requests on the same set. Instead of serializing the articles, you only need

RE: [PHP] Paging script

2009-09-30 Thread Mert Oztekin
Sorry but I dont understand what you mean. Can you be more specific? {1} 2 3 ... 12 (Startup / Total 12 pages) When you click 7 1 ... 6 {7} 8 ... 12 When you click 11 or 12 1 ... 10 11 {12} Do you mean something like this? -Original Message- From: Angelo Zanetti

RE: [PHP] Paging script

2009-09-30 Thread Angelo Zanetti
-Original Message- From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr] Sent: 30 September 2009 12:40 PM To: 'Angelo Zanetti'; php-general@lists.php.net Subject: RE: [PHP] Paging script Sorry but I dont understand what you mean. Can you be more specific? {1} 2 3 ... 12

RE: [PHP] Paging script

2009-09-30 Thread Ashley Sheridan
On Wed, 2009-09-30 at 12:59 +0200, Angelo Zanetti wrote: -Original Message- From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr] Sent: 30 September 2009 12:40 PM To: 'Angelo Zanetti'; php-general@lists.php.net Subject: RE: [PHP] Paging script Sorry but I dont understand

Re: [PHP] Paging script

2009-09-30 Thread Ruben Crespo
Hi all, Maybe it is not just what you need but could be helpfull. Here you have the code: //---paginator.php ?php function paginator ($current, $total, $per_page, $link, $limit) { if ($current ==

RE: [PHP] Paging script

2009-09-30 Thread Angelo Zanetti
_ From: Ruben Crespo [mailto:rumails...@gmail.com] Sent: 30 September 2009 01:23 PM To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] Paging script Hi all, Maybe it is not just what you need but could be helpfull. Here you have the code

RE: [PHP] Paging script

2009-09-30 Thread Mert Oztekin
Zanetti [mailto:ang...@elemental.co.za] Sent: Wednesday, September 30, 2009 1:59 PM To: Mert Oztekin; php-general@lists.php.net Subject: RE: [PHP] Paging script -Original Message- From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr] Sent: 30 September 2009 12:40 PM To: 'Angelo

Re: [PHP] Paging script

2009-09-30 Thread Ruben Crespo
@lists.php.net Subject: Re: [PHP] Paging script Hi all, Maybe it is not just what you need but could be helpfull. Here you have the code: //---paginator.php-- -- ?php function paginator ($current, $total

Re: [PHP] paging

2009-02-10 Thread tedd
At 3:26 AM + 2/10/09, Jim Douglas wrote: Does anyone have a link to any examples of paging? Jim: Sure. http://webbytedd.com/bbb/paging/ -- the code is there different examples here: http://webbytedd.com/ccc/pagination Cheers, tedd -- --- http://sperling.com

Re: [PHP] paging

2009-02-10 Thread Richard Heyes
... Hi, Too lazy to actually read the email (tsk), but there's rather a nice paging library in PEAR that may help. Imaginitively called Pager. -- Richard Heyes HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari: http://www.rgraph.org (Updated January 31st) -- PHP General Mailing

RE: [PHP] paging

2009-02-10 Thread Jim Douglas
a CSS that has left, right, header, footer and a content pane. After I click on the drop down it outputs to the content pane just fine. Thanks, Jim Date: Tue, 10 Feb 2009 08:26:23 -0500 To: jd...@hotmail.com; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: Re: [PHP

Re: [PHP] paging

2009-02-09 Thread Kevin Waterson
On Tue, 2009-02-10 at 03:26 +, Jim Douglas wrote: http://phpro.org/tutorials/Pagination-with-PHP-and-PDO.html Does anyone have a link to any examples of paging? Kevin http://phpro.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] paging at which level

2008-10-19 Thread Richard Heyes
I'm still a little wet behind the ears, nih?! Not Invented Here -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] paging at which level

2008-10-19 Thread Richard Heyes
I've not used a library to achieve paging NIH syndrome? ;-) -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] paging at which level

2008-10-19 Thread Ashley Sheridan
On Sun, 2008-10-19 at 10:23 +0100, Richard Heyes wrote: I've not used a library to achieve paging NIH syndrome? ;-) I'm still a little wet behind the ears, nih?! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] paging at which level

2008-10-18 Thread Richard Heyes
usually i use PEAR and page thanks their table library Table library? Y'know there's a dedicated paging library in PEAR, imaginitively called Pager. , but to avoid high transfer of data from DB to PHP page it is better to do the paging at database level. I would like to know what is your

Re: [PHP] paging at which level

2008-10-18 Thread Robert Cummings
On Sat, 2008-10-18 at 12:54 +0200, Alain Roger wrote: Hi, i would like to know what is the best approach for paging ? usually i use PEAR and page thanks their table library, but to avoid high transfer of data from DB to PHP page it is better to do the paging at database level. If you want

Re: [PHP] paging at which level

2008-10-18 Thread Ashley Sheridan
On Sat, 2008-10-18 at 12:54 +0200, Alain Roger wrote: Hi, i would like to know what is the best approach for paging ? usually i use PEAR and page thanks their table library, but to avoid high transfer of data from DB to PHP page it is better to do the paging at database level. I would like

Re: [PHP] Paging Help

2006-06-20 Thread Juanjo Pascual
?php // Num of records each time $NUM_RECORDS = 10; if ($_GET[pag] == ) { $ini = 0; $pag = 1; } else { $ini = ($pag - 1) * $NUM_RECORDS; } // Query to show $query_rsData = SELECT * FROM table LIMIT . $ini . , . $NUM_RECORDS; $rsData = mysql_query($query_rsData, $DB_CONECTION); //

Re: [PHP] Paging Help

2006-06-20 Thread Andrei
Juanjo Pascual wrote: ?php // Num of records each time $NUM_RECORDS = 10; if ($_GET[pag] == ) { $ini = 0; $pag = 1; } else { $ini = ($pag - 1) * $NUM_RECORDS; } // Query to show $query_rsData = SELECT * FROM table LIMIT . $ini . , . $NUM_RECORDS; $rsData =

Re: [PHP] Paging Help

2006-06-20 Thread Adam Zey
Andrei wrote: Since you query all enregs from table why not query all first and the do mysql_data_seek on result? // Query to show $query_rsData = SELECT * FROM {table} ORDER BY {Whatever field}; $rsData = mysql_query($query_rsData, $DB_CONECTION); $num_total_records = mysql_num_rows(

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread tedd
At 11:11 AM -0500 6/15/06, D. Dante Lorenso wrote: I can't seem to find the equivalent of it in PostgreSQL! The only options I see are: 1. TWO queries. The first query will perform a SELECT COUNT(*) ...; and the second query performs the actualy SELECT ... LIMIT x OFFSET y; -snip-

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 11:11 am, D. Dante Lorenso wrote: I just discovered this neat little gem in MySQL which makes it easy to page large result sets: * SELECT SQL_CALC_FOUND_ROWS * * SELECT FOUND_ROWS() I can't seem to find the equivalent of it in PostgreSQL! The only options I

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread D. Dante Lorenso
Richard Lynch wrote: 3. use the built-in cursor of PostgreSQL which pre-dates MySQL LIMIT and OFFSET clauses, which are non-standard hacks Rasmus introduced back in the day. Care to elaborate? Cast into context of PDO if you can...? Dante -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 7:15 pm, D. Dante Lorenso wrote: Richard Lynch wrote: 3. use the built-in cursor of PostgreSQL which pre-dates MySQL LIMIT and OFFSET clauses, which are non-standard hacks Rasmus introduced back in the day. Care to elaborate? Cast into context of PDO if you can...?

Re: [PHP] paging methodology

2004-05-05 Thread Paul Chvostek
On Tue, May 04, 2004 at 02:37:50PM -0700, Chris W. Parker wrote: I don't follow what $_GET record count from initial query performed above; is for, but that's the basic methodology. well that just meant that after the initial count of records is found it will be retrieved from the

Re: [PHP] paging methodology

2004-05-05 Thread Brian Muldown
Chris W. Parker wrote: ok. this is what i was already doing in my previous app but i was just looking to see if it could be streamlined some how. You could perform the full (without LIMIT) query once, Cache the results array (using PEAR Cache) and move back-and-forth through this Cached array.

Re: [PHP] paging methodology

2004-05-05 Thread John W. Holmes
- Original Message - From: Paul Chvostek [EMAIL PROTECTED] On Tue, May 04, 2004 at 02:37:50PM -0700, Chris W. Parker wrote: well that just meant that after the initial count of records is found it will be retrieved from the querystring instead of through a select statement

RE: [PHP] paging methodology

2004-05-05 Thread Chris W. Parker
John W. Holmes mailto:[EMAIL PROTECTED] on Wednesday, May 05, 2004 7:32 AM said: Personal preference here, I guess, but I don't care for searches that don't tell you how many records were matched (or how many pages you'll have). I think the additional query is well worth it. The number of

RE: [PHP] paging methodology

2004-05-05 Thread Chris
rows. Chris -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:33 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] paging methodology John W. Holmes mailto:[EMAIL PROTECTED] on Wednesday, May 05, 2004 7:32 AM said: Personal preference here

RE: [PHP] paging methodology

2004-05-05 Thread Chris W. Parker
Chris mailto:[EMAIL PROTECTED] on Wednesday, May 05, 2004 10:56 AM said: If you're using MySQL 4+ you could use the SQL_CALC_FOUND_ROWS flag in the select statement. It causes the query to count the number of rows it *would have* returned if there had been no limit clause. do you know

RE: [PHP] paging methodology

2004-05-05 Thread Chris
-Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 11:07 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] paging methodology Chris mailto:[EMAIL PROTECTED] on Wednesday, May 05, 2004 10:56 AM said: If you're using MySQL 4+ you could use

RE: [PHP] paging methodology

2004-05-05 Thread Chris W. Parker
Chris mailto:[EMAIL PROTECTED] on Wednesday, May 05, 2004 11:24 AM said: The documentation for the FOUND_ROWS() function is here: http://dev.mysql.com/doc/mysql/en/Information_functions.html ahh... i see. so it essentially allows you to execute one query while achieving the same two query

RE: [PHP] paging methodology

2004-05-05 Thread Brad Pauly
On Wed, 2004-05-05 at 12:23, Chris wrote: It's certainly faster than SELECT COUNT(*) FROM sometable WHERE . . .; It might not be faster than SELECT COUNT(*) FROM sometable, as that is designed to run very quickly. I believe it will also depend on the type of table you are using. SELECT

Re: [PHP] paging methodology

2004-05-05 Thread John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] do you know if that's any faster than doing a SELECT COUNT(*) FROM table WHERE ... ? I did a couple (unscientific) tests and there doesn't seem to be much of a difference. I'd use the COUNT(*) method just because it's more portable, though. ---John

Re: [PHP] paging methodology

2004-05-05 Thread John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] on a related note... how does BENCHMARK() work? i don't understand their explanation. the reason i ask is because i'd like to test our the efficiency of what you are suggesting compared to what i am currently doing. SELECT BENCHMARK(500, 'SELECT *

RE: [PHP] paging methodology

2004-05-04 Thread Chris W. Parker
John W. Holmes mailto:[EMAIL PROTECTED] on Tuesday, May 04, 2004 1:30 PM said: I don't follow what $_GET record count from initial query performed above; is for, but that's the basic methodology. well that just meant that after the initial count of records is found it will be retrieved

Re: [PHP] Paging / Navigation Help

2002-12-12 Thread 1LT John W. Holmes
Ummm... because that's exactly what you're asking for. Look over your code again. COUNT(*) returns one record in one column, one row. ---John Holmes... - Original Message - From: William Martell [EMAIL PROTECTED] To: phplist [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] [EMAIL

RE: [PHP] paging through results of mysql query

2002-12-05 Thread John W. Holmes
I know I'm trying to re-invent the wheel, but it is because I don't know how they do it. I set up a script to pull a ruleset from mysql and then loop through each row in the set. I then check each row as it loops until I get to the row number I want and start echoing rows. I create the

RE: [PHP] paging through results of mysql query

2002-12-05 Thread Larry Brown
: [PHP] paging through results of mysql query I know I'm trying to re-invent the wheel, but it is because I don't know how they do it. I set up a script to pull a ruleset from mysql and then loop through each row in the set. I then check each row as it loops until I get to the row number I want

Re: [PHP] Paging HOWTO for PHP n' MYSQL

2002-10-02 Thread Rasmus Lerdorf
Just pass the current position from one page to the next and use a LIMIT start,num clause. -Rasmus On Wed, 2 Oct 2002, Francisco Vaucher wrote: Hi people, i've been searching for a while in google and vivisimo for docs that treats paging techniques for php and mysql. And so far i seek

RE: [PHP] paging MySQL layout

2002-05-23 Thread Vail, Warren
What kind of documents? If you are referring to Word or Excel documents, in most cases those applications determine the paging dynamically (usually by looking at the current assigned or default printer, fonts available, any font substitutions where not available, etc. Only permanent page ejects

Re: [PHP] Paging through MySQL results

2001-10-05 Thread Andrey Hristov
select * from some_table Limit 10,30; syntaxis limit start,offset Andrey Hristov IcyGEN Corporation Building Solutions On Friday 05 October 2001 18:52, you wrote: I am a bit new to PHP -- normally use ASP (no booing, please) -- and trying to find an elegant solution to paging x number of

Re: [PHP] Paging through MySQL results

2001-10-05 Thread Joel Ricker
- Original Message - From: Andrey Hristov [EMAIL PROTECTED] select * from some_table Limit 10,30; Something to point out, in some of the older versions of MySQL, Offset starts counting at 0, while in the newer versions, it starts counting at 1. You'll want to check the documentation

Re: [PHP] Paging through MySQL results

2001-10-05 Thread wjt
Question: Does the pagination method using mysql_data_seek method pull in the entire result set, only to be used to display x number of rows? Joel Ricker [EMAIL PROTECTED] wrote in message 00b501c14db9$84e4a4f0$04a3d6d1@joeltklrijxxms">news:00b501c14db9$84e4a4f0$04a3d6d1@joeltklrijxxms...

Re: [PHP] Paging a Recordset

2001-03-15 Thread Web master
you can use 'limit x,y' in MySql. James Crowley wrote: Hi, I want to spread the results of a recordset over a number of pages. In ASP, I would have opened a connection with a client-side cursor... but with PHP (using it's ODBC functions), it only seems to be able to execute an SQL

Re: [PHP] Paging a Recordset

2001-03-15 Thread Manuel Lemos
Hello, James Crowley wrote: Hi, I want to spread the results of a recordset over a number of pages. In ASP, I would have opened a connection with a client-side cursor... but with PHP (using it's ODBC functions), it only seems to be able to execute an SQL statement, and return all

Re: [PHP] Paging results

2001-02-14 Thread David Robley
On Thu, 15 Feb 2001 07:12, Randy Johnson wrote: Can somebody give me a url of an example or an example of how to page results so they can be view by clicking page 1 page 2 or back and next? results obtained from mysql database. Thanks Randy http://px.sklar.com/code.html?code_id=77

Re: [PHP] Paging results

2001-02-14 Thread Ankur Verma
I guess there are good articles on this at phpbuilder.com http://www.phpbuilder.com/columns/rod20001214.php3 http://www.phpbuilder.com/columns/rod2221.php3 hope that helps best regards Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "Randy