note 28949 rejected from function.mysql-fetch-array by nicos
| From: | nicos@php.net | Date: | Wed, 29 Jan 2003 06:34:57 +0000 |
| Subject: | note 28949 rejected from function.mysql-fetch-array by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43029@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?