Jump to content

[SOLVED] troubles with and statement


jacko_162

Recommended Posts

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?!!

 

php_help.gif

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.