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
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
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
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
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,
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
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
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
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
-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
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
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 ==
_
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
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
@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
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
...
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
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
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:
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
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
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:
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
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
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
?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);
//
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 =
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(
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-
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
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
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...?
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
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.
- 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
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
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
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
-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
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
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
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
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 *
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
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
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
: [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
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
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
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
- 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
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...
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
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
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
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
56 matches
Mail list logo