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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
v0id
Forum Newbie
Posts: 2
Joined: Fri Jul 11, 2003 12:37 pm
Contact:

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

Post 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
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post 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
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post 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.
v0id
Forum Newbie
Posts: 2
Joined: Fri Jul 11, 2003 12:37 pm
Contact:

Post by v0id »

Thanks for the help ;)
Post Reply