<html>
<body>
<?
$host="localhost";
$username="";
$password="";
$dbname="register";
$connect= mysql_connect( $host,$username,$password);
if ( !$connect )
{
echo "ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ";
exit();
}else{
echo "สามารถติดต่อกับฐานข้อมูล Mysql ได้ ";
}
mysql_close($connect);
?>
จะขึ้นว่า ติดต่อไม่ได้
ลองที่ cmd ก้อจะ eror ว่า error 1064(42000) you have eror in you sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use show database at line 2
Tag : - - - -
Date :
26 มี.ค. 2551 15:14:57
By :
redseler
View :
1601
Reply :
6
No. 1
Guest
ลองยังไงให้มันขึ้นแบบนี้คับ
error 1064(42000) you have eror in you sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use show database at line 2
ถ้ามันติดต่อ MySQL ไม่ได้ก็ต้องลองเช็คดูแล้วว่า
- MySQL ทำงานปกติดีอยู่หรือป่าว
- Connection String ใส่ค่าผิดหรือป่าว