Posted By

jalsing on 11/21/07


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


MySQL DB Connect


 / Published in: PHP
 

Use to connect to MySQL db. Use in a 'db_connect.inc' type file.

  1. $host = localhost;
  2. $usr = 'user';
  3. $pwd = 'pass';
  4.  
  5. #connect to database
  6. $cid = mysql_connect($host,$usr,$pwd);
  7. if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }

Report this snippet  

You need to login to post a comment.