
September 11th, 2003, 05:13 PM
|
|
Junior Member
|
|
Join Date: Sep 2003
Location: Ohio
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
PLEASE HELP!!using 2 php variables im mysql_query
I'm going nuts here. Ok this is what I'm trying to do. I have a page where someone picks from 2 different categories to sort data by. say the topic is food & they pick fruit & then subcategory apples. I'm sending this info to the results page as variables $selection & $type. now fruit would be one of my fields in my table & my code looks like this:
// Request the text
$result = mysql_query("SELECT * FROM test WHERE @selection=@type");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
What am I doing wrong. Can I not use 2 variables like that in the select statement? I've tried many variations on this same basic idea. If anyone could please help me to fix this or has another suggestion to get these results I would be eternally grateful. I would be happy to clarify anything or provide any further info needed. Sorry if this is stupid but I'm very new to both php & mysql.
*Duplicate Post... Original Thread: http://www.devarticles.com/forum/sh...=&threadid=4975 *
Last edited by tankdogg : September 11th, 2003 at 05:30 PM.
|