Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost"; // Host name
- $username="root"; // Mysql username
- $password=""; // Mysql password
- $db_name="blog"; // Database name
- $tbl_name1="users";
- function makeConnection() {
- // Connect to server and select database
- mysql_connect("$GLOBALS[host]", "$GLOBALS[username]", "$GLOBALS[password]") or die("cannot connect");
- mysql_select_db("$GLOBALS[db_name]") or die("cannot select DB");
- echo "Successfully connected";
- }
- function fireQuery($query) {
- $result=mysql_query($query) or die("ERROR, could not $query");
- return $result;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement