Page 1 of 1

passing parameters dependent on database entry

Posted: Tue Nov 28, 2006 6:52 pm
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

Posted: Tue Nov 28, 2006 7:32 pm
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

Posted: Wed Nov 29, 2006 11:14 am
by slash_gnr3k
sorted it, thanks!