php - Mysql_error is not working properly -


i using below code checking errors in query, working properly, showing duplicate key of primary unique after storing showing error message:

array  (      [0] => duplicate entry '20130222-81' key 'primary'  )  data insertion successful  

here code:

$errors = array();  if (!$connection->query($query))  {     $errors[] = $connection->error; } if(count($errors) === 0)  {     $connection->commit(); }  else  {     $connection->rollback();     print_r($errors); } 


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -