Re: mysql insert

From: Date: Wed, 11 Oct 2000 02:12:41 +0000
Subject: Re: mysql insert
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19464@lists.php.net to get a copy of this message
On Wed, 11 Oct 2000, bryan brown wrote: > I have a script that inserts values (from html > forms) into a mysql table. The insertion looks like > this: > > mysql_db_query("dbname", $insert) or die > (mysql_errno()." ".mysql_error()); > > This works fine. However, there are fields in the > table that cant be null, but after doing the insertion > and viewing the table, those fields are null. > Wouldn't the error be set off and perform the die > function? Its not a big deal now, but when the code > gets into production it will be. Try using mysql_error unconditionally after your database query. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#19464) next »