June 15th, 2000, 04:10 PM
I have a simple insert code to add data from an HTML form to a mysql database.
Here's what it looks like <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
mysql_query("INSERT INTO customerproject(account_number,customer_name,contact,scheduled_work_date,date_work_completed,comment s,total_time_worked,staff_assigned) VALUES
What am I doing wrong? Any suggestions?
June 15th, 2000, 04:47 PM
This code doesn't look so bad, but is that the whole page? You're saying that the php adds two rows to the table or that the data in each column is 2x what it is supposed to be?
June 15th, 2000, 04:52 PM
That is the whole code except for <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><html> and <body>[/code]
It adds two rows to the table.
June 15th, 2000, 05:47 PM
How's it going,
The code looks fine.
Are you sure you haven't accidentally clicked back or refresh to that page and resubmitted the data and redone the query?
I did that once and managed to confuse myself.
June 15th, 2000, 05:58 PM
Nope. This happens everytime. I Click submit once, and it adds it twice, everytime.
Everybody Stumped Yet?
June 15th, 2000, 09:57 PM
I'm Stumped, that is wierd.
Maybe you could try making the customer name field UNIQUE so that the second one wont go in. That is, if you can't stop it adding two in the first place.
June 16th, 2000, 03:20 PM
Thanks for the idea. It solved the problem of adding things twice... but I still dont' know why it was.