Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LAST_INSERT_ID() into variable

Status
Not open for further replies.

camcim

Programmer
Jan 25, 2003
20
0
0
US
Hi all,
If i am using the following query:
PHP:
$sql_query ="INSERT INTO movie_genre (movie_id, genre_id) VALUES (LAST_INSERT_ID(),'$genre_id')";
$result = mysql_query($sql_query);

how can i make the LAST_INSERT_ID() a variable? (inorder to use it later)

Cheers,
camcim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top