I have run into a Parse Error while I was coding a web site for my father-in-law. It is a basic error, yet I can't seem to find the problem. below is the error, and the code leading up to the error.
Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' on line 6
Code:
<?php
// Page information will go here
if ($_GET['page'] == 'company') {
if (isset($_GET['area'] == 'staff')) {
$query = "SELECT * FROM staff";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
From that last line, it goes into echoing HTML to form a table, and create my pages. I have used these lines of code in so many pages, why won't it work. On a scale of 1-5, I'm about a 4 on PHP, so maybe I am missing something? Could it be something farther in my code?
Inyour example above, you are not closing your if statements:
PHP Code:
<?php
// Page information will go here if ($_GET['page'] == 'company') { if (isset($_GET['area'] == 'staff')) { $query = "SELECT * FROM staff"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); } }
?>
__________________
<mgraphic /> - I don't have a solution but I admire the problem.