LiveWire Peer Support Network

Printable Version of Topic "Searching my DB"

- LiveWire Teen Forums & College Forums (http://www.golivewire.com)
-- (http://www.golivewire.com/forums/support-technical.html)
--- Web Design & Search Engine Optimization (http://www.golivewire.com/forums/forum-200-s-0.html)
---- Searching my DB (http://www.golivewire.com/forums/peer-tobein-support-a.html)


-- Posted by Eric 2009 at 2:47 pm on Aug. 30, 2007

this is my code

$cat = $_POST['cat'];
$type = $_POST['type'];

$query = mysql_query("SELECT '$cat' FROM 'band'
WHERE ' . $cat . '= ' . $type . '");
$query_row=mysql_fetch_array($query);
echo($query_row['$type']);

echo $result;

i have a drop down menu that indeicates which table the user wants to search, $cat, and their specification in a text,$type. I just doesnt work i have gotten about 20 differnt results, sometimes it wont return anything, others i will get a resource id#3, and sometiems a syntax error, whenever i change it, if someone would help me please!


www.golivewire.com