Guest User

Untitled

a guest
Nov 25th, 2015
262
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Example transaction in phpDB
  2. // Copyright 2015 Kumar Vivek Namprambhar. All rights reserve
  3.  
  4. include 'phpDB::DB';
  5.  
  6. $db_Connection = DB::createInstance(true, true, null);
  7. $db_Connection->init('vivek', 'vivek123', 'localhost:5601/db');
  8.  
  9. $statement = 'INSERT ' . $_POST['data'] . ' INTO customers ON CONFLICT IGNORE CONSTRAINTS';
  10. $query_Executor = $db_Connection->get_exec();
  11. $result = '';
  12. try {
  13.   $result = $query_Executor->execute($statement);
  14. } catch($ex) {
  15.   try {
  16.     $result = $query_Executor->force_execute($statement);
  17.   } catch($ex) {
  18.     print_r('u have bad Data...');
  19.   }
  20. }
  21.  
  22. $new_result = DB::Util_parse_result2string($result);
  23. print_r($new_result);
  24. print_r('goodbye thank U...');
RAW Paste Data