Problem with php and mysql
| From: | Kevin Demers DSL | Date: | Tue, 04 Mar 2003 23:26:01 +0000 |
| Subject: | Problem with php and mysql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26098@lists.php.net to get a copy of this message | ||
Hi everyone,
One of our customers has written a php application that we are hosting.
Basically, there is a province/state table which populates a combo box.
When the form containing this combo box is submitted, the information is
added into the database.
The problem is that when nothing is selected from the combo box, it adds a
number which seems to be random in the database, rather than the
province/state ID which it references from the province table. Obviously
there are many methods of avoiding this such as javascript to make sure
something is selected, or even giving the combo box a default value, but I
was wondering if anyone knew why the database itself isn't catching the
error (foreign key violation) and accepting the data.
Any ideas?
Thanks in advance for any help,
Kevin
-----------------------------------
Kevin Demers
Technical/Customer Support
Internet Access - WORLDWIDE
3 East Main Street
Welland, ON Canada L3B 3W4
(905) 714-1400 (800) 560-4560
kevind@iaw.on.ca www.iaw.on.ca