note 28949 added to function.mysql-fetch-array
| From: | admiral_chiu at hotmail dot com | Date: | Wed, 29 Jan 2003 00:51:56 +0000 |
| Subject: | note 28949 added to function.mysql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42955@lists.php.net to get a copy of this message | ||
Pretty new to php, and facing the following problem:
$uresult = mysql_query ("select * from user_info");
if (($result = mysql_fetch_array($uresult)) != NULL) {
//do something here.
}
What I actually want to do is to show only 15 results on each page... so if the query returns in
total 45 results, it would be shown on 3 different page. Meaning first page show items 1-15, second
page 16-30, third page 31-45 etc...
I was able to use mysql_num_rows() to determine the total number of rows, but I am having problem
indexing the fetch_array. I was able to go between pages, but I am having problems controlling the
array so that on the 2nd page it would only start from item 16.
What is the best way to do that?
--
http://www.php.net/manual/en/function.mysql-fetch-array.php
http://master.php.net/manage/user-notes.php?action=edit+28949
http://master.php.net/manage/user-notes.php?action=delete+28949
http://master.php.net/manage/user-notes.php?action=reject+28949