Anyway I can get one to work with my current page I have set for queries that have a link?
Also, you'll note I don't have the page numbers in there because I can't get anything to work. If you have any ideas how to integrate that with what I have I'd appreciate it.
<?
$cases=array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","19","20","21","22","23","24","25","26","27","28","29");
// default it to avoid errors
// default query to 2, it avoids errors
$query=(isset($query)?$query:2);
$dep=(($query<1)?"0" . $query:$query);
if(!isset($start)) $start = 0;
$query = "SELECT * FROM circular_product_list WHERE department = $dep LIMIT " . $start . ", 15";
// Connect to the database
mysql_connect ('localhost, 'login', 'pwd');
mysql_select_db ('db');
$result = mysql_query($query); //you should do error checking
//display data
//this block is php code, do not echo it
$bgcolor[0] = "#f3f3f3";
$bgcolor[1] = "#e1e1e1";
$x = 0;
$color=$bgcolor[$x];
//end php code block
while ($row = mysql_fetch_array($result)) {
//output a row in color
//then the next two lines change the color
$x = ($x + 1) % count($bgcolor); //php code, do not echo this
$color=$bgcolor[$x]; //php code, do not echo this
$product = ereg_replace (" ", " ", $row['product']);
echo("<tr bgcolor=$color>");
echo("<td>");
echo("<center>$row[sku]</center>");
echo("</td>");
echo("<td>");
echo("$row[product]");
echo("</td>");
echo("<td>");
echo("<center>$$row[price]</center>");
echo("</td>");
echo("<td>");
echo("<center><form target=paypal action=https://www.paypal.com/cgi-bin/webscr method=post><input type=hidden name=cmd value=_cart><input type=hidden name=business value=kennerking@simflex.com><input type=hidden name=item_name value=$product><input type=hidden name=item_number value=$row[sku]><input type=hidden name=amount value=$row[price]><input type=image src=https://www.paypal.com/images/x-click-but22.gif border=0 name=submit alt=Make payments with PayPal - it's fast, free and secure! height=23 width=87><input type=hidden name=add value=1></form></center>");
echo("</td>");
echo("</center>");
echo("</tr>");
}
echo("</table><BR>");
print("<center><table width=98% border=1 bordercolor=000000 cellpadding=0 cellspacing=0><tr><td width=75>");
// need another query to get the total amount of rows in our table
$query = "SELECT count(*) as count FROM circular_product_list WHERE department = $dep";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$numrows = $row['count'];
if($start > 0){
echo "<center><a href=\"" . $PHP_SELF . "?query=$dep&start=" . ($start - 15) .
"\">Previous</a> </center>";} else {
print "<center> Previous </center>";
}
print("</td>");
print("<td><center>");
print(" ");
// page numbers below
// page numbers above
print("</center></td><td width=75><center>");
if($numrows > ($start + 15)){
echo " <a href=\"" . $PHP_SELF . "?query=$dep&start=" . ($start + 15) .
"\">Next</a> ";} else {
print "<center> Next </center>";
}
print("</td></tr></table>");
?>