AW: [PHP-DB] multiple inserts

From: Date: Sat, 20 Apr 2002 22:33:51 +0000
Subject: AW: [PHP-DB] multiple inserts
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18702@lists.php.net to get a copy of this message
i think, your sql-statement isn´t correct. Maybe you don´t insert the right count of values, or you try to insert NULL in a "NOT NULL"-defined column. Try to "echo" the statement and run it with phpMyAdmin, wich will show you the position of your error in your statement. mysql_insert_id() gives you the insert-id of your last successfull INSERT. Tom > I have the following insert : > mysql_connect( "localhost", "xxxx", "xxxx" ); > mysql_select_db( "xxxx" ); > > mysql_query("INSERT INTO music_album VALUES > (NULL, '$artist_id' ,'$album' ,NULL ,NULL)"); > > mysql_query("INSERT INTO music_songs VALUES > (NULL ,NULL ,NULL ,NULL ,'$songname' ,'$lyrics')"); > > When I run this, the first insert works alright but the second insert > does nothing. What am I doing wrong ? > How do I do a mysql_insert_id()? > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#18702) next »