Jump to content

Recommended Posts

Hi i am new to PHP and MySQL, i have read the basic pagination and then tested and it worked great, i then tried to make it into tables i used the code below but i cannot get it to work, it shows the tables but nothing is in them. i am still using the full pagination code and number and id until i understand it better. thanks for your help inadvance.

 

// get the info from the db   

$sql = "SELECT id, number FROM numbers ORDER BY id DESC LIMIT $offset, $rowsperpage"; 

$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); 

 

// while there are rows to be fetched... 

?>

<table border="1" cellspacing="1" cellpadding="1" style="width: 628px">

<tr>

<th class="style1">ID</th>

<th class="style1">Number</th>

</tr>

 

<?

 

echo "<table>"; 

while ($list = mysql_fetch_assoc($result)) { 

?>

"<tr>"; 

"<td><font color='red'><? $list['id'] ?></font></td> 

"<td><font color='red'><? $list['number'] ?></font></td> 

"</tr>";

 

<?

} // end while 

echo "</table>";

?>

 

Thanks Guys

Link to comment
https://forums.phpfreaks.com/topic/160011-solved-pagination-with-tables-help/
Share on other sites

Sry i also forgot to ask how to make the number section link to another page. i have being using the following code on other projects but i dont think this would work

 

<td><a href="View.php?id=<? echo "$id"; ?>">Veiw</a></td>

 

the link will be fine, but if the other pages exists or knows how to use the get i can't say without seeing it!

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.