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 array to string conversion 
Php :: php value in array 
Php :: php my admin on linux 
Php :: laravel resource api 
Php :: laravel error messages 
Php :: php convert string to array 
Php :: laravel pagination 
Php :: php method type hinting 
Php :: download npm package 
Php :: echo php dropdown from db and save it in a db 
Php :: how to excluse csrf in a route laravel 
Php :: php switch case statement 
Php :: get diff array php 
Php :: square php 
Php :: wp_query custom post type 
Php :: laravel save file or picture directory 
Php :: laravel nginx 
Php :: specify php version composer 
Php :: yii2 sendemail extension 
Php :: append variable into string php 
Php :: in php how to check md5 password 
Php :: rodar migration laravel 
Php :: laravel email validation 
Php :: how to remove third brackets from encoded json array in php 
Php :: acf get all checkbox options 
Php :: laravel compare request domain and app domain and request original domain 
Php :: livewire custom attribute 
Php :: string to array php 
Php :: magento 2 remove order 
Php :: php array remove empty values recursive 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =