PDA

View Full Version : php mysql



tim.j
October 5th, 2004, 05:04 PM
I got a question to ask:if I had some info stored on my database the database table is userdata and it's seperated into:
-review
-id
I want it to show the info from the db but to only show the "review"s that have a specific id like:if "id" = $id then show "review"

λ
October 5th, 2004, 06:00 PM
Instead of using an SQL query like

"SELECT * FROM userdata"
use

"SELECT * FROM userdata WHERE id = '$id'"

Make sure that $id is an int first, all kinds of nasty SQL injection attacks can be caused if it's not.

TwisterMc
October 5th, 2004, 06:01 PM
yea you can do that... do you have a specific question? :)

tim.j
October 6th, 2004, 04:14 AM
yah ok thanks alot.