passing parameters dependent on database entry

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
slash_gnr3k
Forum Commoner
Posts: 43
Joined: Tue Nov 28, 2006 6:41 pm

passing parameters dependent on database entry

Post by slash_gnr3k »

hi! i am implementing a web based menu system and am having a bit of trouble:

i have a view recipes page which lists each recipes name and this is working fine. What i want is to be able to click on the name and the system to open a template page (which i have created) which has fields duch as recipe name, cookingtime etc etc.....) so basically
  • click link
    script retrieves all data about this recipe through its unique id
    a href opens details.php and displays parameters in appropriate fields
its a bit more complex than anything ive done (quite new to this) i ahve passed parameters to a URL before but not dependant on ID
hope this makes sense and someone can help
thanks
Steve
User avatar
evilchris2003
Forum Contributor
Posts: 106
Joined: Sun Nov 12, 2006 6:43 am
Location: Derby, UK

Post by evilchris2003 »

you need a select statment based on the selected id like

Code: Select all

$query = "SELECT name, cooktime< etc, etc FROM Tablename WHERE recipeid='$selected' ";
obviously you will need to alter the variables
slash_gnr3k
Forum Commoner
Posts: 43
Joined: Tue Nov 28, 2006 6:41 pm

Post by slash_gnr3k »

sorted it, thanks!
Post Reply