PHP Parse error: parse error, unexpected T_VARIABLE
Posted: Mon Sep 25, 2006 10:42 pm
Hi all, just starting out on my road to php - got php, mysql and IIS installed on my cough cough windows pc, I can connect to the database via php fine, and php is working on the system.
My problem is I am trying to create a product menu pulled from a database - the code is as follows below
- the error which is in the title referrs to the variable $count
It's probably something blaringly obvious I have missed
My problem is I am trying to create a product menu pulled from a database - the code is as follows below
- the error which is in the title referrs to the variable $count
It's probably something blaringly obvious I have missed
Code: Select all
<?php
// include the header for the homepage located in the file header_home_page.php
include "extras/header_home_page.php"
?>
<body>
<div>
<div id="top_strip">
<div id="logo">
</div>
</div>
<div id="menu">
<h2>Main Menu</h2>
<?php
//include "database/database_connection_string.php"
//Declare Count Variable
$count = 0; //This is used to avoid that "|" is printed before the first menu item
// Get the data into the staging part of the system (not yet available to php
// or MySQL
$query = mysql_query("SELECT * FROM product ORDER BY Product_ID ASC")
or die(mysql_error());
while ($menu_row = mysql_fetch_object($query))
{
if ($count!=0){echo " | ";} // display the | after the menu name
//output the menu name (.$menu_row->Menu.Name.) and on click redirect to product_display.php page and
//pass the variable product_ID to the page (?Product_ID=$menu_row->Product_ID\") then goto a new line (<br>)
echo "<a href=\"product_display.php?Product_ID=$menu_row->Product_ID\">.$menu_row->Menu_Name.</a><br>";
//count = count + 1
$count++;
}
?>
// dont need rest of page code