Hello again,
Ok I've used the error and this is what it comes up with.
Warning: Supplied argument is not a valid MySQL result resource in 15.php on line 121
1064: You have an error in your SQL syntax near 'ORDER BY price, url' at line 1
Here is the modified code. It works when I do not have the order by in there but it will not work when I do have it in there. Could some one help?
<?
if(!isset($start)) $start = 0;
/ declare some relevant variables /
$DBhost = "";
$DBuser = "";
$DBpass = "";
$DBName = "";
$table = "15_over";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "SELECT * FROM $table LIMIT " . $start . ", 10 ORDER BY price, url";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result);
echo mysql_errno() . ": " . mysql_error() . "\n";
$i = 0;
if ($number < 1) {
print "<CENTER><P>There Were No Results for Your Search</CENTER>";
}
else {
while ($number > $i) {
$id = mysql_result($result,$i,"id");
$url = mysql_result($result,$i,"url");
$price = mysql_result($result,$i,"price");
$bandwidth = mysql_result($result,$i,"bandwidth");
$space = mysql_result($result,$i,"space");
print "<table width=100%>";
print " <tr>
<td width=35%><center>$url</center></td>
<td width=10%><center>$price</center></td>
<td width=12%><center>$bandwidth</center></td>
<td width=25%><center>$space</center></td>
</tr>";
print "</table>";
$i++;
}
}
$query = "SELECT count(*) as count FROM $table";
$result = mysql_query($query);
$numrows = $row['count'];
print "<BR><BR>";
print "<table width=100%>";
print "<tr><td width=50%>";
if($start > 0)
echo"<a href=\"" . $PHP_SELF . "?start=" . ($start - 10) .
"\"><center>Previous</center></a><BR>\n</td>";
print "<td width=50%>";
if($numrows > ($start + 10))
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start + 10) .
"\"><center>Next</center></a><BR>\n</td></tr>";
print "</table>";
?>