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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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