Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. $host="localhost";
  2. $user="root";
  3. $password="";
  4. $con=mysql_connect($host,$user,$password);
  5. if(!$con) {
  6. echo '<h1>Connected to MySQL</h1>';
  7. //if connected then Select Database.
  8. $db=mysql_select_db("YOUR_DATABASE_NAME",$con);
  9. $query=mysql_query("YOUR_MYSQL_QUERY",$db);
  10. }
  11. else {
  12. echo '<h1>MySQL Server is not connected</h1>';
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement