My Code:
Code: Select all
$table;
$table .= "<table id='pageme'><thead><tr><th align='center'>Request #</th><th align='center'>Date</th><th align='center'>Subject</th><th align='center'>Status</th></tr></thead><tbody>";
$get = mysql_query("SELECT * FROM support WHERE customer='$num' LIMIT $start,$perpage");
while($row = mysql_fetch_row($get)) {
$table .= "<tr><td align='center'>$row[0]</td><td>$row[1]</td><td>$row[3]</td><td>$row[5]</td></tr>";
}
$previous = $start - $perpage;
$next = $start + $perpage;
$table .= "</tbody><tfoot><tr>";
if (!($start<=0)) {
$table .= "<a onclick=\"LoadPage('widgets.php?start=$previous');\">prev</a>";
}
$i = 1;
for ($x=0;$x<$num_rows;$x+=$perpage) {
if ($start != $x)
$table .= "<a onclick=\"LoadPage('widgets.php?start=$x');\">$i</a>";
else
$table .= "<b>$i</b>";
$i++;
}
if (!($start>=($num_rows-$perpage))) {
$table .= "<a onclick=\"LoadPage('widgets.php?start=$next');\">next</a>";
}
$table .= "</tr></tfoot></table>";
echo $table;Output Code:
