Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function connect_selct_db($host,$username,$password,$database_name){
  2. $mysql_host = ($host != "") ? $host : "localhost";
  3. $mysql_user = ($username != "") ? $username : "root";
  4. $mysql_pwd = ($password != "") ? $password : "";
  5. $database_name = ($database_name != "") ? $database_name : "production";
  6.  
  7. $link = mysqli_connect("$mysql_host","$mysql_user","$mysql_pwd") or die("Unable to connect to Host");
  8. mysqli_select_db($link,"production");
  9. return $link;
  10. }
  11.  
  12. function execQuery($query) // function to execute queries
  13. {
  14. $exexQry = mysqli_query($link,$query);
  15.  
  16. return $exexQry;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement