avatar.alex Posted March 20, 2007 Share Posted March 20, 2007 ok I am trying to create a script that manages my layout system on my site ok and I would like the page to display 10 layouts on the page at once so how would I get it to do so. This is the code please help me: P.S. If I add a table to the information for example. echo "<b>layimage:</b> $layimage<br>"; echo "<b>authname:</b> $authname<br>"; echo "<b>authurl:</b> $authurl<br>"; echo "<b>layname:</b> $layname<br>"; echo "<b>preurl:</b> $preurl<br>"; echo "<b>downurl:</b> $downurl<br>"; echo "<a href=\"update.php?id=$id\">Update</a> - <a href=\"delete.php?id=$id\">Delete</a>"; echo "<br><br>"; and delete all the text and insert a table will that tabe show up each time I submit a layout or will all the laouts be cramed into one table. <a href="add.html">Add entry</a><br> <br> <?php include("connect.php"); $query="SELECT * FROM lms "; $result=mysql_query($query); $num = mysql_num_rows ($result); mysql_close(); if ($num > 0 ) { $i=0; while ($i < $num) { $layimage = mysql_result($result,$i,"layimage"); $authname = mysql_result($result,$i,"authname"); $authurl = mysql_result($result,$i,"authurl"); $layname = mysql_result($result,$i,"layname"); $preurl = mysql_result($result,$i,"preurl"); $downurl = mysql_result($result,$i,"downurl"); $id = mysql_result($result,$i,"id"); echo "<b>layimage:</b> $layimage<br>"; echo "<b>authname:</b> $authname<br>"; echo "<b>authurl:</b> $authurl<br>"; echo "<b>layname:</b> $layname<br>"; echo "<b>preurl:</b> $preurl<br>"; echo "<b>downurl:</b> $downurl<br>"; echo "<a href=\"update.php?id=$id\">Update</a> - <a href=\"delete.php?id=$id\">Delete</a>"; echo "<br><br>"; ++$i; } } else { echo "The database is empty"; }?> Quote Link to comment Share on other sites More sharing options...
interpim Posted March 20, 2007 Share Posted March 20, 2007 you want to look into Pagination... here is a tutorial on how to do this... http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php Quote Link to comment Share on other sites More sharing options...
avatar.alex Posted March 21, 2007 Author Share Posted March 21, 2007 im still learning PHP so could someone help me out by pasting the code together it will help me learn the coding and get familiar with that coding. Thank you Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted March 21, 2007 Share Posted March 21, 2007 Yes u need pagination, the url i am giving u is easy to adopt and understand. http://www.php-mysql-tutorial.com/php-mysql-paging.php If any problem during implementation u can post again. Quote Link to comment Share on other sites More sharing options...
DBookatay Posted March 21, 2007 Share Posted March 21, 2007 Yes u need pagination, the url i am giving u is easy to adopt and understand. http://www.php-mysql-tutorial.com/php-mysql-paging.php If any problem during implementation u can post again. Thanks for the post mmarif4u. I was wondering how to do this also, and this tutorial was very easy to understand... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.