Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php pdo error handling

$database -> errorInfo()[0] # SQLSTATE error code (a five characters alphanumeric identifier defined in the ANSI SQL standard).
$database -> errorInfo()[1] # Driver-specific error code.
$database -> errorInfo()[2] # Driver-specific error message.
Comment

pdo error message

try{
	//your pdo query here
}
catch(PDOException $e) {
	echo json_encode(array('Error'=>$e->getMessage()));
}
Comment

error pdo php Exception

// very simple explination .

try{
  codeA... }
catch(EXCEPTION $ex){
  codeB....

}

//the code in the block Catch excuted if there is an erro in the codeA in the block TRY

  
  
Comment

PREVIOUS NEXT
Code Example
Php :: laravel collection collapse 
Php :: update cart subtotal woocommerce 
Php :: php array serialize 
Php :: php check if user exists in database 
Php :: magento2 move Exception #0 (Exception): Notice: Undefined offset: 2 in /var/www/nucleus/htdocs/vendor/magento/framework/Encryption/Encryptor.php on line 591 
Php :: laravel wrong timestamp 
Php :: sort php 
Php :: laravel 8 seeding 
Php :: smarty php 
Php :: xampp php 5.6 download 64 bit 
Php :: php insert to mysql 
Php :: laravel add request 
Php :: array to comma separated string php 
Php :: new static laravel 
Php :: array shift php 
Php :: validate names regex php 
Php :: where clause in laravel 
Php :: acos() php 
Php :: laravel collection last 
Php :: php explode empty string 
Php :: Laravel route not calling function of controller 
Php :: flatten in array php 
Php :: check if custom post type exists 
Php :: laravel logout after password change 
Php :: laravel new line in session flash message 
Php :: laravel textarea value 
Php :: how to install phpmyadmin on windows 10 
Php :: how to filter laravel eloquent 
Php :: console.log for php 
Php :: php max 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =