daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Jan 20th, 2017 368 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $username = "username";
  5. $password = "password";
  6. $dbname = "myDB";
  7.  
  8. $tableName = "tableName";
  9.  
  10. $conn = mysqli_connect($servername, $username, $password, $dbname);
  11.  
  12. if(!conn){
  13.     echo "Error: Unable to connect to MySQL." . PHP_EOL;
  14.     echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
  15.     echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
  16.     exit;
  17. }
  18.  
  19. echo "Success: Connection to MySQL was made!";
  20.  
  21. $sql = "SELECT id FROM . '" . $tableName . "'";
  22.  
  23. mysqli_close($conn);
  24.  
  25. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top