Google

วันเสาร์ที่ 7 กรกฎาคม พ.ศ. 2550

PHP+MySql วิธีการ Connect ฐานข้อมูล

PHP code
----------------------
$con = mysql_connect("ชื่อ server หรือ IP","ชื่อผู้ใช้ Username","รหัสผ่าน Password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
----------------------
คำอธิบาย
ชื่อ server หรือ IP คือ ชื่อ server หรือ IP address เช่น 192.168.0.1
ชื่อผู้ใช้ Username คือ ชื่อผู้ใช้งานฐานข้อมูล
รหัสผ่าน Password คือ รหัสผ่านฐานข้อมูล

ไม่มีความคิดเห็น: