Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Location
    india
    Posts
    12

    Red face Unanswered: DBD::mysql::st execute failed: Duplicate entry

    I am facing the following error
    DBD::mysql::st execute failed: Duplicate entry ...

    Because i have unique key on that field.
    Now i want to insert value if value is not present
    If record presend then no error should be generated.

    Right now it shows me above error.


    I am looking for code of error handling that performs operation and if operation failed then execute next statement without affecting next statement.

    Thanks for viewing this post
    Last edited by bhawin13; 04-13-04 at 08:04.

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    you can switch off the error-messages:
    Code:
    $dbh->{RaiseError} = 0;
    $dbh->{PrintError} = 0;
    $dbh is the database-handler...
    board.perl-community.de - The German Perl-Community

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •