J4B Posted April 3, 2009 Share Posted April 3, 2009 So I never got this working, and as of now everything but the ID is working. What I need it to do is grab the id and put it in. $user_id=$myid['id']; list($myid) = mysql_fetch_array(mysql_query("SELECT id FROM members WHERE username = '$myusername'")); $insert_movie = mysql_query("INSERT INTO movie (num, title, total, num_rated) VALUES ('$imdb', '$title', '$rate', '1' )") or die(mysql_error()); $insert_movie1 = mysql_query("INSERT INTO members_movies (id, movie, rating) VALUES ('$user_id', '$imdb', '$rate')") or die(mysql_error()); thats basically what I have right now. It doesn't put anything in the ID spot of members_movies. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/152462-solved-grabbing-id-from-database/ Share on other sites More sharing options...
revraz Posted April 3, 2009 Share Posted April 3, 2009 Where do you get $myid['id'] from? If it doesn't put anything into $user_id, then something is wrong before that code. Link to comment https://forums.phpfreaks.com/topic/152462-solved-grabbing-id-from-database/#findComment-800709 Share on other sites More sharing options...
J4B Posted April 3, 2009 Author Share Posted April 3, 2009 Those are the only lines that use id. Link to comment https://forums.phpfreaks.com/topic/152462-solved-grabbing-id-from-database/#findComment-800710 Share on other sites More sharing options...
J4B Posted April 3, 2009 Author Share Posted April 3, 2009 Whoops, my bad I just realized with what you said that the $user_id=$myid['id]; needs to be after the list... Thanks! Link to comment https://forums.phpfreaks.com/topic/152462-solved-grabbing-id-from-database/#findComment-800714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.