Re: Paginatating PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's better to use SQL_CALC_FOUND_ROWS and information function FOUND_ROWS().

For more information see http://dev.mysql.com/doc/refman/4.1/en/information-functions.html

Find: FOUND_ROWS()

Iky


OKi98 wrote:

Chris Carter wrote:
>There is enough data to display this result and to paginate but its simply showing the
>else condition which does not have NEXT or PREVIOUS hyperlinked.
>...
>$query_count = "SELECT count(*) FROM students";
>$result_count = mysql_query($query_count);
>$totalrows = mysql_num_rows($result_count);
well, the result is always 1 (even if no students are present), you need to use some mysql_fetch_* function to get the count of students
ie.
$tmp=mysql_fetch_row($result_count);
$totalrows=$tmp[0];


OKi98


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux