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 Link to comment https://forums.phpfreaks.com/topic/95247-query-syntax/ 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? Link to comment https://forums.phpfreaks.com/topic/95247-query-syntax/#findComment-487875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.