| | |
Next and previous links
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2004
Posts: 5
Reputation:
Solved Threads: 0
the following code read from database by limit to show 2 records
now i want to make link or button to show the next 2 records or the previons 2 records
please tell me how i can do that ??????????????? :o
the cod is
<?
$link = mysql_connect("localhost","","")
or die("error connect");
$dbrusult=mysql_db_query("mydata","select * from table LIMIT 0, 2 ");
echo ("<table border=1>");
echo ("<td align=center>NO</td>");
echo ("<td align=center>NAME</td>");
echo ("<td align=center>Country</td>");
while ($row=mysql_fetch_array($dbrusult))
{
echo "<tr>";
echo "<td align=center>$row[0]</td>";
echo "<td align=center>$row[1]</td>";
echo "<td align=center>$row[2]</td>";
echo "</tr>";
}
echo ("</table>");
mysql_free_result($dbrusult);
mysql_close($link);
?>
now i want to make link or button to show the next 2 records or the previons 2 records
please tell me how i can do that ??????????????? :o
the cod is
<?
$link = mysql_connect("localhost","","")
or die("error connect");
$dbrusult=mysql_db_query("mydata","select * from table LIMIT 0, 2 ");
echo ("<table border=1>");
echo ("<td align=center>NO</td>");
echo ("<td align=center>NAME</td>");
echo ("<td align=center>Country</td>");
while ($row=mysql_fetch_array($dbrusult))
{
echo "<tr>";
echo "<td align=center>$row[0]</td>";
echo "<td align=center>$row[1]</td>";
echo "<td align=center>$row[2]</td>";
echo "</tr>";
}
echo ("</table>");
mysql_free_result($dbrusult);
mysql_close($link);
?>
If you're trying to make a PHP record paging page, I suggest you look at:
http://www.daniweb.com/techtalkforums/thread1720.html
http://www.daniweb.com/techtalkforums/thread1720.html
Check out my blog at http://www.shinylight.com for more stuff about web dev.
![]() |
Similar Threads
- how to implement dynamic rows paging when user clicks next or previous links (JSP)
- Next/Previous Navigation (HTML and CSS)
- Newbie needs help (PHP)
- ASP vbscript recordset paging headache (ASP)
- storing a query for later use (PHP)
- using foreach with multi-dimensional arrays (PHP)
- new thread format (DaniWeb Community Feedback)
Other Threads in the PHP Forum
- Previous Thread: Problems with session_unregister and / or unset()
- Next Thread: php project
| Thread Tools | Search this Thread |
# .htaccess 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation download dynamic echo email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link login loop mail menu mlm mod_rewrite multiple mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validation validator variable video web xml youtube






