Hello.
I am getting this error:
Parse error: parse error in C:\Program Files\textimage13.php on line 33
This is line 32: ORDER BY image_date DESC LIMIT $from, $max_results");
This is line 34 $result = mysql_query ($sql, $conn);
Could you help? plzzzzz! 🙁
<?php
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 6;
$from = (($page * $max_results) - $max_results);
$sql = ("SELECT gameandtoyname, pricevalue, dollsimage.image_id, dollsimage.image_date, dolls.pricetype, prices.pricetype, prices.pricevalue
FROM dollsimage, dolls, prices
WHERE dollsimage.image_id = dolls.image_id and dolls.pricetype = prices.pricetype
ORDER BY image_date DESC LIMIT $from, $max_results");
$result = mysql_query ($sql, $conn);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
$no_per_line = 2;
$this_no = 0;
$str = "";
if (mysql_num_rows($result)>0) {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$i++;
$str .= $i.". ";
'<table>
<tr>';
'<td>'$str .="<img border=\"1\" height=\"90\" width=\"100\"
src=\"imagedolls.php?act=view&iid=".$row["image_id"]."\"> "
'</td>';
</tr>
<tr>';
'<td>'$str .= "[".$row["gameandtoyname"]."] " '</td>';
</tr>
<tr>';
'<td>'$str .= "$".$row["pricevalue"]." " '</td>';
</tr>
</table>';
if ($this_no < $no_per_line)
{
$this_no++;
}
else
{
$str .= "<br />";
$this_no = 0;
}
}
print $str;
}
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM dolls"),0);
// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results / $max_results);
echo "<center>Select a Page<br />";
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><<Previous</a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> ";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>";
}
echo "</center>";
?>