php mysql insert null value
I have a problem with my php/mysql program. First the tables.
Dealer(dealer_id, first_name, last_name, phone, email, direct_offer)
The problem when I add to the Booths table without a dealer_id the value of 0 is inserted into the database instead of NULL. There is no cascading between Dealer.dealer_id and Booths.dealer_id. Booths.dealer_id isn't a not null field and its default value is NULL.
Here is the insert code:
$input_sql="INSERT INTO booths (booths, dealer_id) VALUES ('$booths', '$dealer_id')";
mysql_query("$input_sql")or die("(".mysql_errno().") Error:".mysql_error());
If you require more information please ask.
Last edited by spoody_goon; 03-28-2004 at 09:46 AM.