Search
 
SCRIPT & CODE EXAMPLE
 

PHP

pdo transaction

<?php
/* Begin a transaction, turning off autocommit */
$dbh->beginTransaction();

try	{
	/* Change the database schema and data */
    $sth = $dbh->exec("DROP TABLE fruit");
    $sth = $dbh->exec("UPDATE dessert
        SET name = 'hamburger'");
}
catch(Exception $e){
  /* Recognize mistake and roll back changes */
  $dbh->rollBack();
}
/* Commit changes */
$dbh->commit();
Comment

PREVIOUS NEXT
Code Example
Php :: php loop through json 
Php :: migration not found laravel 
Php :: php unset session variable 
Php :: wordpress the loop 
Php :: php header pdf open in browser 
Php :: php time format am pm 
Php :: curl follow redirect php 
Php :: php check whether the url is http or https 
Php :: php ucfirst all words 
Php :: livewire onkeydown 
Php :: delete folder laravel 
Php :: how to create cookie in php 
Php :: wordpress get post id 
Php :: artisan make model with migration 
Php :: how to remove first element in array php 
Php :: how get last item in foreach in laravel 
Php :: category name wp query 
Php :: set nav link active on the basis of route laravel 8 
Php :: php time limit 
Php :: create unique filename php 
Php :: php json key value loop 
Php :: pusher-php-server laravel 
Php :: redirect on validation error laravel to specific section laravel 
Php :: must be an instance of IlluminateHttpRequest 
Php :: wp max revisions 
Php :: using a php array in jquery 
Php :: php get ip address 
Php :: twig json_encode 
Php :: php echo html as text 
Php :: how to create controller in specific folder laravel 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =