| re: dont know how to get rid of syntax error, unexpected T_VARIABLE
i have check the code thoroughly to find the error i am still getting the following error: Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\Catalogue.php on line 23
[PHP]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
$conn = mysql_connect("localhost","root","")
or die (mysql_error());
mysql_select_db("Shop_Test",$conn) or die (mysql_error());
$display_block = "<h1>Categories</h1>
<p>Select Category</p>";
$get_cat = "SELECT Cat_ID, cat_title, cat_description FROM Store_Categories ORDER BY cat_title";
$get_cat_result = mysql_query ($get_cat) or die (mysql_error());
if (mysql_num_rows ($get_cat_result) < 1) {
$display_block = "<p><em>I'm sorry nothing to browse.</em></p>";
} else {
while ($cat = mysql_fetch_array($get_cat_result)) {
$Cat_ID = $cat[Cat_ID];
$cat_title = strtoupper (stripslashes($cat[cat_title]));
$cat_desc = stripslashes ($cat[cat_description]);
$display_block .= "<p><a
href=\ "$_SERVER['PHP_SELF']?Cat_ID=$Cat_ID\">$cat_title</a><br>$cat_desc</p>";
if ($_GET[Cat_ID] == $Cat_ID) {
$get_items = "SELECT Store_ID, Item_title, Item_Price FROM
Store_Items WHERE Cat_ID = $Cat_ID
ORDER BY Item_Title";
$get_item_results = mysql_query ($get_items) or die (mysql_error());
if (mysql_num_rows($get_item_results) < 1 {
$display_block = "<p><em>Sorry No Items</em></p>";
} else {
$display_block .= "<ul>";
while ($items = mysql_fetch_array ($get_items_results)) {
$item_id = $items [Store_ID];
$item_title = stripslashes ($items[Item_Title]);
$item_price = $items[Item_Price];
$display_block .= "<li><a href=\ "showitem.php?item_id=$item_id\ ">$item_title</a>
/</strong> (\$$item_price)";
}
$display_block .= "<ul>";
}
}
}
}
?>[/PHP]
|