I don't know how to make table variable, so I will give the code from my first page and if you can help me I will be very thankful: $selected = mysql_select_db("spotovi1", $dbhandle) or die("Could not select DB");
if (!isset($_GET['page'])) {
$page = 1;
} else {
$page = $_GET['page'];
}
// Define the number of results per page
$max_results = 20;
// Figure out the limit for the query based
// on the current page number.
$from = (($page * $max_results) - $max_results);
// Perform MySQL query on only the current page number's results
$sql = mysql_query("SELECT * FROM oblast_metal ORDER BY id DESC LIMIT $from, $max_results");
$id= $row['id'];
$row['id']=$id;
$row['Artist']=$Artist;
$row['Song']=$Song;
while ($row = mysql_fetch_array($sql)) { ?>
<table border="0" bordercolor=#A49F8B align = "center"
cellspacing="0" cellpadding= 3 width= 500 >
<tr onMouseOver="this.bgColor='#355466';" onMouseOut="this.bgColor='#2c4453';">
<td width= "170" ><font color="white" font size=3><font face="Arial, Helvetica, sans-serif"><? echo
$row['Artist']; ?></font></td>
<td width= "200"><font color="white"><font face="Arial, Helvetica, sans-serif"><? echo
$row['Song']; ?></font></td>
<td width= "50"><font face="Arial, Helvetica, sans-serif"><a href="<?php echo "download.php?id=".$row['id'].">".$row['Artist']."- ". $row['Song'] . "";?>" target="_blank" style="text-decoration:none"><b><font color=#A49F8B>Download</b></a></a></font></td>
</tr>
<?php
echo "</table>";
}
echo "</br></br></br></br>";
echo "</center>";
echo "<center><font color=#C8C9CA><font size = 4>Select a Page<br />";
// Figure out the total number of results in DB:
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM oblast_metal"),0);
// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results / $max_results);
// Build Page Number Hyperlinks
// Build Previous Link
if ($page > 1) {
$prev = ($page - 1);
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=$prev\"><font color=#C8C9CA> <b><font size = 3><< Previous</a> ";
}
for ($i = 1; $i <= $total_pages; $i++) {
if (($page) == $i) {
echo "<b><font size = 3><font color = #C8C9CA>$i ";
} else {
echo "<b><font color=#C8C9CA><a href=\"" . $_SERVER['PHP_SELF'] . "?page=$i\"><style=text-decoration:none><b><font color=#C8C9CA><font size = 3>[ $i ]</a> ";
}
}
// Build Next Link
if ($page < $total_pages) {
$next = ($page + 1);
echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?page=$next\"><font color=#C8C9CA><font size = 3> Next >></a>";
}
?>
And the code from my second page is on this page!
Thank you all in advance and for helping me with this. Thank You :)