Advertisement
Guest User

Untitled

a guest
Jan 11th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. $host="localhost"; // Host name
  3. $username="root"; // Mysql username
  4. $password=""; // Mysql password
  5. $db_name="blog"; // Database name
  6. $tbl_name1="users";
  7.  
  8. function makeConnection() {
  9. // Connect to server and select database
  10. mysql_connect("$GLOBALS[host]", "$GLOBALS[username]", "$GLOBALS[password]") or die("cannot connect");
  11. mysql_select_db("$GLOBALS[db_name]") or die("cannot select DB");
  12. echo "Successfully connected";
  13. }
  14.  
  15. function fireQuery($query) {
  16. $result=mysql_query($query) or die("ERROR, could not $query");
  17. return $result;
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement