Page 1 of 1

id=1&class=pc ... I n33d HELP

Posted: Fri Jul 11, 2003 12:37 pm
by v0id
Hello for all you people out there wishing to help me, and thanks.

First of all, you must know that my knowledge about PHP isn't the greatest, i declare myself to be a noob but learning fast :) .
The question is: I am coding a page about games (reviews, previews, the usual) and i wanted to know how to divide games' reviews by pages, for example: I have a game in my database with id=1 & class=pc.. and i wanted that when i used for example reviews.php?id=1&class=pc it would show me the information i wanted. I think it's simple because i see it a lot in websites, i just don't know how to do it. Just by reading this noob post, thanks :lol:

Stay well,
v0id

Posted: Fri Jul 11, 2003 12:44 pm
by daven
1. j00 4R3 !1337. Sorry, but I felt a need to poke at you for using l33t.
2. Check out this sticky for how to pass variables: viewtopic.php?t=511
3. Google is your friend for tutorials.

Daven, who is rather b*tchy today for no particular reason

Posted: Fri Jul 11, 2003 2:03 pm
by DuFF
Basically you just want to query your database using the variables in the URL. So it would be like:

Code: Select all

$query="SELECT * FROM tablename WHERE id='$id' AND class='$class'";
Then you use a loop to get all the information from the particular row that was selected and then output the information using PHP.

Posted: Fri Jul 11, 2003 3:36 pm
by v0id
Thanks for the help ;)