Hello,
Just wondering if i could have some help, im new to php/mysql.. i wanted to ask if somebody could help me learn how to send a value.. eg .. screensaver.php?id=20 .. then select it from a database with the given id..?
thx = rob..
---------------------
Check out my Free Screen Saver Site
robsscreensavers.com
--------------------






mairving posted this at 13:58—5th November 2002.
They have: 2,256 posts
Joined: Feb 2001
You've got the first part right. When you pass the value like screensaver.php?id=20, it passes the variable $id to the next screen which in this case would be 20. To pick it up using MySQL, you would just use a simple Select statement:
SELECT fieldnames (or *) from tablename where id='$id'
Which in this case would say SELECT * (all values) from tablename where id='20'.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
Arryob posted this at 11:14—6th November 2002.
He has: 24 posts
Joined: Apr 2000
cheerz i will check it out later tonight
Peter J. Boettcher posted this at 00:25—7th November 2002.
They have: 812 posts
Joined: Feb 2000
Don't forget to build in some error checking incase someone types in the address bar, like "screensaver.php?id=thiswillbreak"
Make sure before you send it to the database that you validate it as proper input.
Have fun!
PJ | Are we there yet?
pjboettcher.com