|
|
|
mysql เชื่อม databaseไม่ได้ ดูที่คับเป็นไร รีบมาคับส่ง project คับ.. |
|
|
|
|
|
|
|
Code (PHP)
<?
mysql_connect("localhost","root","krichkamol");
mysql_select_db("member");
if(trim($_POST["username"]) == "")
{
echo "Please input Username!";
exit();
}
if(trim($_POST["password"]) == "")
{
echo "Please input Password!";
exit();
}
if(trim($_POST["name"]) == "")
{
echo "Please input Name!";
exit();
}
$strSQL = "SELECT * FROM useinfo WHERE Username = '".trim($_POST['username'])."' ";
$objQuery = mysql_query($strSQL) or die(mysql_error() .'<br />'. $strSQL);
$strSQL = "INSERT INTO useinfo (username,password,name,e-mail,tel,address) VALUES ('".$_POST["username"]."',
'".$_POST["password"]."','".$_POST["name"]."','".$_POST["e-amil"]."','".$_POST["tel"]."','".$_POST["address"]."')";
$objQuery = mysql_query($strSQL) or die(mysql_error() .'<br />'. $strSQL);
echo "Register Completed!<br>";
echo "<br> Go to <a href='index.php'>Login page</a>";
mysql_close();
?>
Tag : PHP
|
|
|
|
|
|
Date :
2011-03-07 18:59:59 |
By :
theranai |
View :
796 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
mysql_connect("localhost","root","krichkamol") or die (mysql_error());
mysql_select_db("member") or die (mysql_error());
ลองเพิ่ม or die เข้าไปช่วยตรวจสอบน่ะครับ
|
|
|
|
|
Date :
2011-03-07 23:00:36 |
By :
iieszz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'. $strSQL); echo "Register Completed!
"; echo "
Go to Login page"; mysql_close(); ?>
|
|
|
|
|
Date :
2011-03-08 00:15:56 |
By :
theranai |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2011-03-08 02:37:21 |
By :
PlaKriM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|