A little help from some of you experts.

wxdqz

New Member
I am really new to working with php and mysql. I have looked at site after site about how to make limit and next - prev work. I have got the limit to work but I honestly can't grasp this next prev stuff. I was wanting to know if one of you could just tell me what I need to put in my code to make it work. I am limiting the rows at 25 and the code is like this. If anyone could help me with this I would be extremly greatful. But if your going to point me to another website please don't it will just confuse me more.

<?php

mysql_connect (localhost, username, pass);

mysql_select_db (dbname);

if ($name == "")
{$name = '%';}

if ($type == "")
{$type == '%';}

if ($realm == "")
{$realm == '%';}

if ($magic == "")
{$magic == '%';}

if ($zone == "")
{$zone == '%';}

if ($useable_by == "")
{$useable_by == '%';}

if ($category == "")
{$category == '%';}



$result = mysql_query ("SELECT * FROM Armour WHERE name LIKE '$name%' AND type LIKE '$type%' AND realm Like '$realm%' AND magic Like '$magic%' AND zone Like '$zone%' AND useable_by Like '$useable_by%' AND category Like '$category%' ORDER BY name ASC LIMIT 0,25");

if ($row = mysql_fetch_array($result)){
print ("<tr><td>");
print ("<font size=2>");
print ("Item Name");
print ("</td><td>");
print ("<font size=2>");
print ("Type");
print ("</td><td>");
print ("<font size=2>");
print ("Category");
print ("</td><td>");
print ("<font size=2>");
print ("Useable By");
print ("</td><td>");
print ("<font size=2>");
print ("Cost");
print ("</td><td>");
print ("<font size=2>");
print ("Factor");
print ("</td><td>");
print ("<font size=2>");
print ("Absorb");
print ("</td><td>");
print ("<font size=2>");
print ("Weight");
print ("</td><td>");
print ("<font size=2>");
print ("Realm");
print ("</td><td>");
print ("<font size=2>");
print ("Zone");
print ("</td><td>");
print ("<font size=2>");
print ("Obtained");
print ("</td><td>");
print ("<font size=2>");
print ("Special");
print ("</td></tr>");

do {

print ("<tr><td>");
print ("<font size=2>");
print $row["name"];
print ("</td><td>");
print ("<font size=2>");
print $row["type"];
print ("</td><td>");
print ("<font size=2>");
print $row["category"];
print ("</td><td>");
print ("<font size=2>");
print $row["useable_by"];
print ("</td><td>");
print ("<font size=2>");
print $row["cost"];
print ("</td><td>");
print ("<font size=2>");
print $row["factor"];
print ("</td><td>");
print ("<font size=2>");
print $row["absorb"];
print ("</td><td>");
print ("<font size=2>");
print $row["weight"];
print ("</td><td>");
print ("<font size=2>");
print $row["realm"];
print ("</td><td>");
print ("<font size=2>");
print $row["zone"];
print ("</td><td>");
print ("<font size=2>");
print $row["obtained"];
print ("</td><td>");
print ("<font size=2>");
print $row["special"];
print ("</td></tr>");
print ("<p>");

} while($row = mysql_fetch_array($result));

} else {print "Sorry, no records were found!";}

?>
 
Back
Top