Assuming that you've got MySQL running on your PC, the correct hostname is "localhost":
<?php
$host = 'localhost';
$user = 'my_username';
$pass = 'my_password';
$db = 'students';
$link = mysql_connect($host, $user, $pass)
or die("Couldn't connect to MySQL server on $host: " . mysql_error());
mysql_select_db($db, $link)
or die("Couldn't access database $db on MySQL server $host: ".mysql_error());
// etc.
?>
BTW, I really hope that you didn't just post your username and password here.
Jon Stephens
MySQL Documentation Team @ Oracle
MySQL Dev Zone
MySQL Server Documentation
Oracle
Edited 1 time(s). Last edit at 05/08/2005 03:23AM by Jon Stephens.