Hi
I am making the administration area for a product catalog. To add a product a person will select a category fro a list which will be pulled from the database. However, there is something going wrong which i am not able to understand. Any help would be appreciated. Heres the relevant part of the code.
the header and the footer just contain the html formatting and the connect.inc has the information to connect to the database.PHP Code:<?
$title=Add Prdocut;
include("../connect.inc");
include("templates/header.inc"); ?>
<?
function build_category_tree(&$output, $parent=0, $indent="")
{
$qid = mysql_query("SELECT id, name FROM categories WHERE parent_id = $parent");
while ($cat = mysql_fetch_array($qid)) {
$output .= "<option value='$cat["id"]'>$indent" . $cat["name"];
if ($cat["id"] != $parent) {
build_category_tree($output, $cat["id"], $indent." ");
}
}
}
?>
Category
Category: <SELECT NAME="sizeid" SIZE=1>
<OPTION SELECTED VALUE="" >Select Category
<OPTION VALUE="">---------
<?php
$output="";
build_category_tree($output);
echo($output);
<? include("templates/footer.inc") ?>
Heres the error I am getting from the browser on running the script.
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\apache\htdocs\surplusgemstones\admin\test.php on line 12
I have no idea what that means.
Thanks for the help in advance.





Bookmarks