> I am getting duplicate entries in mysql database using the following and
am
> not sure why. Similar code for deleting and modifying the db work fine.
Using
> most recent versions of apache/modperl/embperl/mysql.
>
> [- use DBI;
> $driver="DBI:mysql";
> $database="Fitchhillinn";
> ($date,$title,$content)=($fdat{date},$fdat{title},$fdat{content});
> my $dbh=DBI->connect("dbi:mysql:$database:localhost",$user,$password) or
die
> "Can't connect";
> $dbh->do("INSERT INTO specials VALUES ('$date','$title','$content')");
> $dbh->disconnect; -]
>

I would expect to see duplicate entries in the DB if you call this page
twice (for example if anybody make a double click instead of  a single on
the submit button). If the page is really only called once, there can't be
duplicates entries, unless you have a second INSERT anywhere else. In the
other case you have to check before the INSERT if the record already exists.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to