Sephiriz Posted November 10, 2003 Share Posted November 10, 2003 Ok, suddenly I\'ve been receiving syntax warnings that never before appeared. What is wrong with the following query: $query10 = \"SELECT `Name` FROM `users` WHERE `ID` = \'$_SESSION[user]\'\"; Quote Link to comment Share on other sites More sharing options...
effigy Posted November 10, 2003 Share Posted November 10, 2003 $query10 = \\\"SELECT `Name` FROM `users` WHERE `ID` = \'{$_SESSION[user]}\'\\\"; echo out the session user to be sure it has the value you expect it to. Quote Link to comment Share on other sites More sharing options...
Sephiriz Posted November 10, 2003 Author Share Posted November 10, 2003 I see, can you provide me with a link as to where to find documentation for the exact syntax I should use that will always work? Also, what would be the correct way to make this query: $query2 = \"SELECT * FROM $Name WHERE Genre = \'$_GET[Genre]\' ORDER BY $View\"; Quote Link to comment Share on other sites More sharing options...
effigy Posted November 10, 2003 Share Posted November 10, 2003 below is information regarding why to used curly braces. they need to be used with arrays so when the variable is parsed within double quotes it knows the breadth of the variable. http://us2.php.net/manual/en/language.type...parsing.complex 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.