Hello JIM-CONT, Thursday, December 20, 2001, FLAHERTY, JIM-CONT <[EMAIL PROTECTED]> wrote:
FJC> hello, I have redhat 7.1 and perl is loaded with mysql , I have several FJC> scripts with perl , DBI, DBD and mysql working fine , so If think I have FJC> everything set up properly FJC> But I get an error : FJC> DBD::mysql::st execute failed: Duplicate entry '204' for key 1 at FJC> /var/www/cgi-bin/sobt/chstatus2.cgi line 107. looks like you trying to insert record into your database with the primary key, which already exists. FJC> unable to execute query at /var/www/cgi-bin/sobt/chstatus2.cgi line 107. FJC> Issuing rollback() for database handle being DESTROY'd without explicit FJC> disconnect(). FJC> this is the section of code ( with line numbers) FJC> 97 $dbh2 = DBI ->connect($data_source, $username, $password); FJC> 98 my $sth2 = $dbh2 -> prepare("select title from media1 where num ='$num'"); FJC> 99 FJC> 100 $sth2 -> execute or die " unable to execute query "; FJC> 101 FJC> 102 FJC> 103 $dbh2 =DBI ->connect($data_source, $username, $password); FJC> 104 my $sth2 = $dbh2 -> prepare("insert into history(num,title,date,user1)values('$num','$date1','$date1','$name')"); FJC> 105 FJC> 106 FJC> 107 $sth2 -> execute or die " unable to execute query "; FJC> 108 FJC> 109 FJC> 110 Best wishes, Maxim mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]