Jump to content

divided data into page


saad|_d3vil

Recommended Posts

Hi i have make a database table and i inserted table in the website on this site http://www.maza4fun.com/joke/ the table is too big now i want to make 2 or 3 page so table get short . how i do this i have paste code here

<?php
$con = mysql_connect("localhost","apnimusk","password");
if (!$con){



die('Could not connect: ' . mysql_error());
}

mysql_select_db("apnimusk_other", $con);
if(isset($_GET['id']) && is_numeric($_GET['id'])){



$result = mysql_query("SELECT * FROM `joke` WHERE `id` = '".$_GET['id']."'");



echo "<table border='1'>



<tr>




</tr>";


while($row = mysql_fetch_array($result)){





echo "<tr>";





echo "<td>" . $row['name'] . "</td>";	



echo "</tr>";


echo "<tr>";




echo "<td>" . $row['text'] . "</td>";





echo "</tr>";


}



echo "</table>";
}else{



$result = mysql_query("SELECT * FROM `jokes`");



echo "<table border='1'>



<tr>



<th>Jokes</th>


</tr>";



while($row = mysql_fetch_array($result)){





echo "<tr>";








echo "<td>" ."<a href='?id=".$row['id']."'>".$row['name']."</a>" . "</td>";





echo "</tr>";



}



echo "</table>";
}
mysql_close($con);
?>

 

thank in advance

Link to comment
https://forums.phpfreaks.com/topic/122091-divided-data-into-page/
Share on other sites

I remember i posted in an exact topic yesterday. You could just "bump" the old topic if you wanted attention, but still you will need to explain clearly what you want to achieve. If your question is about pagination, then take a look here and see what you can find.

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.