You know when you click on a link on some website and it gives you a list or a table, w/ say 50 results, and at the bottom will show you <next page> 1, 2, 3,...7 <last> and so on. So these other pages are created dynamically to show the next 50 results. Is there a way to do this w/ php and mysql?
I have a database w/ names, and a table w/ the letters of the alphabet, and when a user clicks a letter it shows a table w/ all the names starting w/ that letter, but i dont want the table to be a mile long, so i wanted it to create other pages, is there a way to do this w/ php, if not what do i need to do it?
Also, perhaps an alternative to that, i have this simple code to create a dynamic html table from a mysql query, but it only puts the data into 1 column, what if i wanted to create a table w/ 2 or 3 columns? Perhaps some nested loop is needed, but i am very noobish, so any help would be appreciated, thanks.
<?php
$con = mysql_connect("server","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("bands", $con);
$result = mysql_query("SELECT * FROM list WHERE name LIKE 'B%' ORDER BY name");
echo "<table border='1'>
<tr>
<th>Bands</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . "<a href=\"/bands/list/" . $row['link'] . ".html\">" . $row['name'] . "</a>" . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>