PHP MySQL Connect


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. define ('DB_USER', '');
  4. define ('DB_PASSWORD', '');
  5. define ('DB_HOST', '');
  6. define ('DB_NAME', '');
  7.  
  8. $dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die('Could not connect to MySQL: ' . mysql_error());
  9. mysql_select_db (DB_NAME) OR die('Could not select the database: ' . mysql_error());
  10.  
  11. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.