•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 428,578 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,676 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2493 | Replies: 1
![]() |
•
•
Join Date: Jun 2004
Posts: 5
Reputation:
Rep Power: 0
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);
?>
•
•
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation:
Rep Power: 12
Solved Threads: 4
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
_.:: my websites ::._
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Next/Previous Navigation (HTML and CSS)
- Clean Previous Next Script for MySQL results (PHP)
- storing a query for later use (PHP)
- using foreach with multi-dimensional arrays (PHP)
- new thread format (DaniWeb Community Feedback)
- Getting next and previous row in a MySQL set! (PHP)
- How do I delete links in IE search bar? (Web Browsers)
- Links not working in web sites using IE 6.0 (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: Problems with session_unregister and / or unset()
- Next Thread: php project



Linear Mode