RE: [PHP-DB] SQL

From: Date: Wed, 18 Oct 2000 17:32:54 +0000
Subject: RE: [PHP-DB] SQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3742@lists.php.net to get a copy of this message
Once you have done the insert into your table, you can use the mysql_insert_id to obtain the value of the auto_increment field of the record you just inserted. See: http://www.php.net/manual/html/function.mysql-insert-id.html for more info :) HTH Sam Masiello System Analyst Chek.Com (716) 853-1362 x289 smasiello@chekinc.com -----Original Message----- From: Matthew Brealey [mailto:webmaster@richinstyle.com] Sent: Wednesday, October 18, 2000 11:42 AM To: php-db@lists.php.net Subject: [PHP-DB] SQL I am currently making a webmail system. I use this query: $query="insert into email values(null,'$from','$to','$subject',null,'','','',null)"; and: mysql_query($query) or die(mysql_error()); The first column is an auto_incremented id, which I need to know so I can store the content of the email in a file with that name. What PHP function do I need? -- Random fortune Q: Why did the germ cross the microscope? A: To get to the other slide. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#3742) next »