Posted By

onefastsnail on 05/24/12


Tagged


Versions (?)

mysql connection


 / Published in: PHP
 

  1. <?
  2. $u = "root";
  3. $p = "root";
  4. $host = "localhost";
  5. $db = "dev";
  6. $link = mysql_connect($h, $u, $p) or die("Unable to connect to MySQL");
  7. $selected = mysql_select_db($db, $link) or die("Could not select ".$db);
  8.  
  9. $query = "select * from table";
  10. $sql = mysql_query($query);
  11.  
  12. mysql_close($link);
  13. ?>

Report this snippet  

You need to login to post a comment.