Advertisement
Guest User

config

a guest
Mar 20th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php
  2.  
  3. function DBCommand ($sqlLine) {
  4.  
  5.     $sql_servername = "sched.rossware.net";
  6.     $sql_username = "Jason";
  7.     $sql_password = "4lGBIzjnwn0rPuOn";
  8.     $sql_database = "JasonDev";
  9.  
  10.     $dsn = "'mysql:host='.$sql_servername.';dbname='.$sql_database';charset=utf8mb4'";
  11.  
  12.     try
  13.     {
  14.         $pdo = new PDO('mysql:host='.$sql_servername.';dbname='.$sql_database,$sql_username,$sql_password);
  15.  
  16.         //echo "Connected successfully";
  17.     }
  18.     catch (PDOException $e)
  19.     {
  20.     echo "Connection failed: " .$e->getMessage();
  21.     }
  22.  
  23.     $stmt = $pdo->prepare($sqlLine);
  24.     $stmt->execute();
  25.  
  26.  
  27.     if ($stmt->rowCount() > 0) {
  28.         $result=true;
  29.         //echo "yes";
  30.     } else {
  31.         //echo "no";
  32.         $result=false;
  33.     }
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement