hello guys
i am retrieving all the record from the table & want to display 5 record at a time with next & previous buttons.I am using PHP & Ms-SQL sever 7.0.How should i go about it.
Help plzzzzzzz
thanx in advance
Bye
displaying certain no. of records using PHP-SQL 7.
Moderator: General Moderators
-
ashish_cal2
- Forum Newbie
- Posts: 7
- Joined: Sun Apr 21, 2002 2:20 pm
- Contact:
by doing using the limit options of a select query you should get what you re looking for :
select * from t_table limit offset, number_of_rows
in your case :
$query = "select * from t_table limit " . $offset . " , 5 " ;
and with a link change the offset value :
<a href="<?= $PHP_SELF ?>?offset=<?= $offset + 5 ?>">
select * from t_table limit offset, number_of_rows
in your case :
$query = "select * from t_table limit " . $offset . " , 5 " ;
and with a link change the offset value :
<a href="<?= $PHP_SELF ?>?offset=<?= $offset + 5 ?>">
Yes but...
As you say I wrote:
$result = mysql_query( "SELECT * FROM news ORDER BY id DESC LIMIT 5" );
but it gives me the first 5 WITHOUT showing the very first one!
What's the problem?:(
$result = mysql_query( "SELECT * FROM news ORDER BY id DESC LIMIT 5" );
but it gives me the first 5 WITHOUT showing the very first one!
What's the problem?:(