Jellicle Posted February 2, 2012 Share Posted February 2, 2012 Chaps I'm trying to run a query constructed from values passed in a URL. The URL looks like this: http://domain.com/scripts/listrecords.php?state=NT&suburb=Darwin In my php file I do this: $query = "select * from dogs where state = '".mysql_real_escape_string($_GET['state'])."' AND suburb = '".mysql_real_escape_string($_GET['suburb'])."'; When I do just: $query = "select * from dogs where state = '".mysql_real_escape_string($_GET['state'])."' It works. But when I add the second variable it doesn't. What am I doing wrong? Jellicle Quote Link to comment Share on other sites More sharing options...
Jellicle Posted February 2, 2012 Author Share Posted February 2, 2012 Solved. Bloody quote was missing from the end of the query. Phew. J 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.