jeppers Posted January 2, 2009 Share Posted January 2, 2009 i am not sure why it won't pick up the id from but it is now starting to get to me so could someone please have a look at this code and maybe tell me where i am going wrong i have 2 pages one where the user can change the oprion in a menu sytem and one where it retives the data using the $id. hear is the code and the user id from the <?php //retrive the users information $query = "SELECT food_id, title, description, price FROM foods WHERE food_id=$id"; $result = @mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) == 1){//valid id show form //get the users information $row = mysql_fetch_array($result, MYSQL_NUM); hear is the id it is ment to pick up http://localhost//edit_food.php?id=43 so what to do can you help Link to comment https://forums.phpfreaks.com/topic/139186-solved-why-wont-it-pick-up-the-id/ Share on other sites More sharing options...
micmania1 Posted January 2, 2009 Share Posted January 2, 2009 You need to use $_GET['id'] Link to comment https://forums.phpfreaks.com/topic/139186-solved-why-wont-it-pick-up-the-id/#findComment-727993 Share on other sites More sharing options...
jeppers Posted January 2, 2009 Author Share Posted January 2, 2009 is there any chance you can point me in correct direction, in my code to help me wright that code in so it works. Link to comment https://forums.phpfreaks.com/topic/139186-solved-why-wont-it-pick-up-the-id/#findComment-727994 Share on other sites More sharing options...
jeppers Posted January 2, 2009 Author Share Posted January 2, 2009 sorry i am so stuiped i just missed that all out.......... Link to comment https://forums.phpfreaks.com/topic/139186-solved-why-wont-it-pick-up-the-id/#findComment-727996 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.