jacko_162 Posted August 22, 2008 Share Posted August 22, 2008 Hello again everyone for the second time today hopefully you can help a guy out with some more code snippets.. this is a sample URL i am having problems with; http://www.sample.com/catagory.php?name=Tangs with the above URL i then use this php code to call up certain database entries; $result = mysql_query("SELECT * FROM $table1 WHERE catagory='".$_GET[name]."'"); i then went to change the URL to this; http://www.sample.com/catagory.php?name=Tangs&id=6 with the above URL i tried to use the following PHP code but to no avail and errors?! $result = mysql_query("SELECT * FROM $table1 WHERE catagory='".$_GET[name]."' AND id='".$_GET[iD]."'"); basically i want it to pull information when the catagory "name=tangs" and id="6" here is screen dump of the catagory table where information is pulled from, my head is in bits trying to think this one through?!! can anyone help me with my situation!?!? Thank you kind in advance. Link to comment https://forums.phpfreaks.com/topic/120919-solved-troubles-with-and-statement/ Share on other sites More sharing options...
Fadion Posted August 22, 2008 Share Posted August 22, 2008 The GET indexes should be strings: $_GET['name']; $_GET['id']; Link to comment https://forums.phpfreaks.com/topic/120919-solved-troubles-with-and-statement/#findComment-623315 Share on other sites More sharing options...
jacko_162 Posted August 22, 2008 Author Share Posted August 22, 2008 fixed it now. Link to comment https://forums.phpfreaks.com/topic/120919-solved-troubles-with-and-statement/#findComment-623330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.