<?php
$conn = new PDO('sqlite:C:\path\to\file.sqlite');$stmt = $conn->prepare('INSERT INTO my_table(my_id, my_value) VALUES(?, ?)');$waiting = true; // Set a loop condition to test forwhile($waiting) {
try {
$conn->beginTransaction();
for($i=0; $i < 10; $i++) {
$stmt->bindValue(1, $i, PDO::PARAM_INT);
$stmt->bindValue(2, 'TEST', PDO::PARAM_STR);
$stmt->execute();
sleep(1);
}
$conn->commit();
$waiting = false;
} catch(PDOException $e) {
if(stripos($e->getMessage(), 'DATABASE IS LOCKED') !== false) {
// This should be specific to SQLite, sleep for 0.25 seconds
// and try again. We do have to commit the open transaction first though
$conn->commit();
usleep(250000);
} else {
$conn->rollBack();
throw $e;
}
}
}
?>
amzn_assoc_placement = "adunit0";
amzn_assoc_tracking_id = "sellingon-20";
amzn_assoc_ad_mode = "search";
amzn_assoc_ad_type = "smart";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "US";
amzn_assoc_default_search_phrase = "Beauty";
amzn_assoc_default_category = "All";
amzn_assoc_linkid = "8a5aeb9d02c991348d0d037e1d535d71";
amzn_assoc_design = "in_content";
amzn_assoc_title = "Search your favorites but";
Friday, December 7, 2018
Subscribe to:
Post Comments (Atom)
form validation
function formsubmit ( ) { var empname = document .getElementById ( 'emp_name' ). value ; var email = document .getElem...
-
<!DOCTYPE html> <html> <title>basic encruption example</title> <head> <?php // DEFINE our cipher ...
-
PHP - Sacar XSS function RemoveXSS($val) { $val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val); // ...
No comments:
Post a Comment