I just recently helped someone else with a similar issue....  

is your PHP code (and therefore your insert) getting executed when the form is being 
displayed to the user initially, and then again when the form is submitted?

> -----Original Message-----
> From: Erich C. Beyrent [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 28, 2003 10:19 AM
> To: [EMAIL PROTECTED]
> Subject: Insert happens twice
> 
> 
> Hey folks,
> 
> I am having a dreadful problem here, and I cannot get to the 
> root of it.  It
> appears that every time I do an INSERT, the insert happens 
> twice.  I have
> spent several days on Google, but with no luck.
> 
> Some background - I am using PHP and Smarty on a site. Here 
> is one of the
> tables in my database that is having the problem:
> 
> CREATE TABLE composers (
>     ComposerID bigint(20) unsigned NOT NULL auto_increment,
>     ComposerFname varchar(50) default NULL,
>     ComposerLname varchar(60) default NULL
>     DiscountID int(11) default NULL,
>     PRIMARY KEY (ComposerID)
> )
> 
> So I pass some values in from a form, and I end up with this:
> 
> $sql = "insert into composers(ComposerFname, ComposerLname) values('',
> 'Bach')";
> 
> which then gets executed.  My debug statements indicate that 
> this is only
> getting executed once.  However, I end up with two new entries in my
> composers table.  I know I can solve this by making the 
> fields unique, but
> I'd have to do that for every table in the database, when 
> what I'd really
> like to do is find out why the insert is happening twice.
> 
> Any ideas?
> 
> -Erich-
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to