EchoFool Posted March 9, 2008 Share Posted March 9, 2008 I have a query which doesn't like my curly brackets.... but i don't know how to put it in correctly: $LOG = mysql_query("INSERT INTO stafflog ('UserID','TimeEvent','Log') VALUES ('{$_SESSION['Current_User']}','Date','$Me[{$_SESSION['Current_User']}] has viewed $Choice logs for $Username[$UserID]')") Or die(mysql_error()); where it says: $Me[{$_SESSION['Current_User']}] In the database it would look like Username[234] But i get this error: Parse error: syntax error, unexpected T_CURLY_OPEN, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\logpanel.php on line 121 Quote Link to comment Share on other sites More sharing options...
trq Posted March 9, 2008 Share Posted March 9, 2008 Do youself a favour and store the query in a var, this makes it easier to debug. <?php $sql = " INSERT INTO stafflog ( 'UserID','TimeEvent','Log' ) VALUES ( '{$_SESSION['Current_User']}','Date','$Me[{$_SESSION['Current_User']}] has viewed $Choice logs for $Username[$UserID]')"; $LOG = mysql_query($sql) or die($sql . "<br />" . mysql_error()); ?> What does this produce? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.