Jump to content

Prev. 1|2|3 Next


avatar.alex

Recommended Posts

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"; }?>

Link to comment
https://forums.phpfreaks.com/topic/43507-prev-123-next/
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/43507-prev-123-next/#findComment-211771
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.