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\Cat alogue.php on line 23
[php]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<?php
$conn = mysql_connect(" localhost","roo t","")
or die (mysql_error()) ;
mysql_select_db ("Shop_Test",$c onn) or die (mysql_error()) ;
$display_block = "<h1>Categories </h1>
<p>Select Category</p>";
$get_cat = "SELECT Cat_ID, cat_title, cat_description FROM Store_Categorie s ORDER BY cat_title";
$get_cat_result = mysql_query ($get_cat) or die (mysql_error()) ;
if (mysql_num_rows ($get_cat_resul t) < 1) {
$display_block = "<p><em>I'm sorry nothing to browse.</em></p>";
} else {
while ($cat = mysql_fetch_arr ay($get_cat_res ult)) {
$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_titl e</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_resul ts = mysql_query ($get_items) or die (mysql_error()) ;
if (mysql_num_rows ($get_item_resu lts) < 1 {
$display_block = "<p><em>Sor ry No Items</em></p>";
} else {
$display_block .= "<ul>";
while ($items = mysql_fetch_arr ay ($get_items_res ults)) {
$item_id = $items [Store_ID];
$item_title = stripslashes ($items[Item_Title]);
$item_price = $items[Item_Price];
$display_block .= "<li><a href=\ "showitem.php?i tem_id=$item_id \ ">$item_tit le</a>
/</strong> (\$$item_price) ";
}
$display_block .= "<ul>";
}
}
}
}
?>[/php]
sorry bout the layout. i have specified the part which says has an error
really appreciate the help.
To make it more clear enclose any code within the proper code tags. - moderator
[php]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<?php
$conn = mysql_connect(" localhost","roo t","")
or die (mysql_error()) ;
mysql_select_db ("Shop_Test",$c onn) or die (mysql_error()) ;
$display_block = "<h1>Categories </h1>
<p>Select Category</p>";
$get_cat = "SELECT Cat_ID, cat_title, cat_description FROM Store_Categorie s ORDER BY cat_title";
$get_cat_result = mysql_query ($get_cat) or die (mysql_error()) ;
if (mysql_num_rows ($get_cat_resul t) < 1) {
$display_block = "<p><em>I'm sorry nothing to browse.</em></p>";
} else {
while ($cat = mysql_fetch_arr ay($get_cat_res ult)) {
$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_titl e</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_resul ts = mysql_query ($get_items) or die (mysql_error()) ;
if (mysql_num_rows ($get_item_resu lts) < 1 {
$display_block = "<p><em>Sor ry No Items</em></p>";
} else {
$display_block .= "<ul>";
while ($items = mysql_fetch_arr ay ($get_items_res ults)) {
$item_id = $items [Store_ID];
$item_title = stripslashes ($items[Item_Title]);
$item_price = $items[Item_Price];
$display_block .= "<li><a href=\ "showitem.php?i tem_id=$item_id \ ">$item_tit le</a>
/</strong> (\$$item_price) ";
}
$display_block .= "<ul>";
}
}
}
}
?>[/php]
sorry bout the layout. i have specified the part which says has an error
really appreciate the help.
To make it more clear enclose any code within the proper code tags. - moderator
Comment