Jump to content

[SOLVED] Grabbing ID from database


J4B

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.