Page 1 of 1

Newbie - Parser error help[Solved]

Posted: Thu Jul 07, 2005 8:55 pm
by nexus6
I get this error:
"Parse error: syntax error, unexpected T_BOOLEAN_AND" on line 19.

Code: Select all

line 18 if (isset($_POST['tableName']))
     19 && isset($_POST['item_id']) 
     20  $table = sqlite_escape_string($_POST['tableName']);
     21    $id = sqlite_escape_string($_POST['item_id']);
     22 
     23
     24 if (isset($_POST['Delete'])) {
     25	echo "Delete";
     26 if (!empty($_POST['item_id'])) {
     27	$id = sqlite_escape_string($_GET['item_id']);
     28 $query = "DELETE FROM $table WHERE item_id='$id'";
     29 $result = sqlite_query($handle, $query) or die("Error in query:     
        ".sqlite_error_string(sqlite_last_error($handle)));
     30 }
     31 } else {
in line 19 the problem is "&& isset" is there a alternative instead og "&&" (i have tried the "AND") or kan somebody help me correct this problem.

Posted: Thu Jul 07, 2005 9:03 pm
by hawleyjr
Your parentheses are messed up:

Code: Select all

line 18 if (isset($_POST['tableName']))
     19 && isset($_POST['item_id'])
Should be:

Code: Select all

line 18 if (isset($_POST['tableName'])
     19 && isset($_POST['item_id']))

Posted: Thu Jul 07, 2005 9:05 pm
by nexus6
YES! it works - Thanks! :)