|
 |
|
INSERT มีข้อผิดพลาดเกิดขึ้น รบกวนผู้รู้ช่วยทีค่ะ แก้หลายรอบแล้วแงๆ |
|
 |
|
|
 |
 |
|
เกิดขึ้นมันต้องมีต่อว่าอะไร ช่วยบอกให้ครบด้วยครับ
|
 |
 |
 |
 |
Date :
2009-05-16 15:12:12 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปรึกษา PHP ฟรีจร้าจากแยกทำไมอ่า
$sql = "insert into mem set name='$name',province='$province' ";
$result = mysql_query($sql);
if (!$result) {
echo("เอ็กซิคิวต์คำสั่ง SQL ไม่ได้ " . mysql_error() );
}
deawx
[email protected]
|
 |
 |
 |
 |
Date :
2009-05-16 15:14:49 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือ ว่า ไปcopy code มาแก้อีกทีอะค่ะ แต่ว่าพออัพ ขึ้นอีกโอสใช้ได้ พอไปอีกโฮสที่จะใช้งานจริงๆ ดันใช้ไม่ได้อะค่ะ
ช่วยด้วยยแงๆ
|
 |
 |
 |
 |
Date :
2009-05-16 15:28:15 |
By :
กิ๊ฟ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "db_per1";
$conn = mysql_connect( $hostname, $username, $password );
if ( ! $conn )
die ( "ไม่สามารถติดต่อกับ MySQL ได้" );
mysql_select_db ( $dbname, $conn )
or die ( "ไม่สามารถเลือกฐานข้อมูล db_per1 ได้" );
$SQLTXT = "INSERT INTO mem ( name , province ) ";
$SQLTXT .= "VALUES ( '$_POST[name]' ,'$_POST[province]') ";
mysql_query( $SQLTXT, $conn )
or die ( "INSERT มีข้อผิดพลาดเกิดขึ้น" ) . mysql_error();
mysql_close ( $conn );
?>
|
 |
 |
 |
 |
Date :
2009-05-16 15:31:51 |
By :
teez1232002 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|