LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 629 users online 225325 members 897 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Krebons
Interests: Ummm, stuff
Mood: Annoyed
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 33 MPM
Fresh Topics
  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Adding Reply

Quoting Post
Archived Topic: It will not be bumped to the top of the forum.
Topic Searching my DB
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
Eric 2009 Posted 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!

Replies
Eric 2009 Posted 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!

All 3 previous replies displayed.