Newbie - Parser error help[Solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nexus6
Forum Newbie
Posts: 20
Joined: Fri Jun 17, 2005 3:50 am
Location: Denmark

Newbie - Parser error help[Solved]

Post 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.
Last edited by nexus6 on Thu Jul 07, 2005 9:06 pm, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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']))
User avatar
nexus6
Forum Newbie
Posts: 20
Joined: Fri Jun 17, 2005 3:50 am
Location: Denmark

Post by nexus6 »

YES! it works - Thanks! :)
Post Reply