Wednesday, June 2, 2010

open sql database with php

<?php
  // general information
  $host="hostname";
  $username="username";
  $password="sqlpassword";
  $db_name="databasename";
  // connect to mysql
  mysql_connect("$host","$username","$password") or die ("failed to connect server");
  mysql_select_db("$db_name") or die ("failed to select db");
?>

No comments:

ShowCalendar