ibrahimjan Posted May 9, 2012 Share Posted May 9, 2012 (edited) Hi All, I got this sql connection to my table wb, it all seems to work fine in phpmyadmin, when testing sql, but when i want to us it, it comes up with: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING inC:\----------\test3.php on line 75 line 75 is the $query_wb $query_wb = "SELECT CONCAT( "[", GROUP_CONCAT( CONCAT("{weID:'",`weID`,"'"), CONCAT(",weName:'",`weName`,"'}") ) ,"]") AS json FROM wb;"; any Ideas how to make it work?? Edited May 9, 2012 by Ibrahim Home Jan Link to comment Share on other sites More sharing options...
justsomeguy Posted May 9, 2012 Share Posted May 9, 2012 You need to escape the double quotes that you're using inside the query. Notice how the code is colored, each time you use a double quote inside the query it either starts or ends the query string instead of putting an actual quote in the query. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now