Guest User

Untitled

a guest
Jun 25th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. /*** mysql hostname ***/
  3. $hostname = 'localhost';
  4.  
  5. /*** mysql username ***/
  6. $username = 'emmiose_aloevera';
  7.  
  8. /*** mysql password ***/
  9. $password = '************';
  10.  
  11. $dbname = 'emmiose_aloevera';
  12.  
  13. $link = connect($hostname, $username,$password);
  14.  
  15. function connect($dbname, $username, $password){
  16.     $link = @mysql_connect($dbname, $username, $password);
  17.     if (!$link)
  18.         die("Could not connect: ".mysql_error());
  19.     else{
  20.         $db = mysql_select_db(DB);
  21.         if(!$db)
  22.             die("Could not select database: ".mysql_error());
  23.         else return $link;
  24.     }
  25. }
  26.  
  27. function getContent($link){
  28.     $res = @mysql_query("SELECT * FROM stalkers", $link);
  29.     if(!$res)
  30.         die("Error: ".mysql_error());
  31.     else
  32.         return $res;
  33. }
  34.  
  35. getContent($link);
  36.  
  37. ?>
Add Comment
Please, Sign In to add comment