Jump to content

[SOLVED] Pagination with Tables HELP


luke1983

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!

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.