Example #1 mysql_connect() example
<?php
//mysql_connect()這個function括號內要接:(1)db_server(2)db_user(3)db_passwd
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link)
{
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';mysql_close($link); //關閉連結資料庫
?>
reference: php.net
沒有留言:
張貼留言