|
 |
|
สร้างฟอร์มแล้วไม่สามารถบันทึกข้อมูลลง mysql ได้ครับผม (เครียดมากเลยครับ) |
|
 |
|
|
 |
 |
|
<?
$name_reg=$_POST[name_reg];
$surname_reg=$_POST[surname_reg];
$sex_reg=$_POST[sex_reg];
$age_reg=$_POST[age_reg];
$identity_reg=$_POST[identity_reg];
$addcard_reg=$_POST[address_card_reg];
$addsick_reg=$_POST[address_sick_reg];
$telephone_reg=$_POST[telephone_reg];
$status_reg=$_POST[status_reg];
//$date_reg=date("y-m-d");
if ($name_reg=="" or $surname_reg=="" or $age_reg=="" or
$identity_reg=="" or $addcard_reg=="" or $addsick_reg=="" or
$telephone_reg=="" or $status_reg"") {
echo "<h3>ERROR : กรุณากรอกข้อมูลให้ครบ</h3>"; exit ( );
}
include "connect.php";
$sql="insert into sick
values (' ' , '$name_reg' , '$surname_reg' , '$sex_reg' , '$age_reg' , '$identity_reg' , '$addcard_reg' , '$addsick_reg' , '$telephone_reg' , '$status_reg')";
$result=mysql_db_query($db_member,$sql);
if ($result) {
echo "<h3>ข้อมูลของท่านบันทึกเรียบร้อยแล้ว</h3>";
echo "<A HREF='register.html'คลิกเพื่อเข้าระบบ</A>
<BR><BR>";
} else {
echo "<h3>ไม่สามารถบันทึกข้อมูลได้</h3>";
}
mysql_close();
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
23 พ.ค. 2549 15:53:30 |
By :
วา |
View :
2268 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปิดดูใน Edit Plus นะคะ
<?
//////////µÃ§¹ÕéäÁèµéͧãªé post ¡çä´é¤Ð¤èÒÁҹФÐ//////////////////////////////
$name_reg;//ÁѹÁÕ¤èÒáÅéǵ͹àÃÒãÊè¢éÍÁÙÅ
//$name_reg=$_POST[name_reg];
//$surname_reg=$_POST[surname_reg];
//$sex_reg=$_POST[sex_reg];
//$age_reg=$_POST[age_reg];
//$identity_reg=$_POST[identity_reg];
//$addcard_reg=$_POST[address_card_reg];
//$addsick_reg=$_POST[address_sick_reg];
//$telephone_reg=$_POST[telephone_reg];
//$status_reg=$_POST[status_reg];
//$date_reg=date("y-m-d");
if ($name_reg=="" or $surname_reg=="" or $age_reg=="" or
$identity_reg=="" or $addcard_reg=="" or $addsick_reg=="" or
$telephone_reg=="" or $status_reg"") {
echo "<h3>ERROR : ¡ÃسҡÃÍ¡¢éÍÁÙÅãËé¤Ãº</h3>"; exit ( );
}
include "connect.php";
$sql="insert into sick ( ãÊèª×èÍfileld )values (' ' , '$name_reg' , '$surname_reg' , '$sex_reg' , '$age_reg' , '$identity_reg' , '$addcard_reg' , '$addsick_reg' , '$telephone_reg' , '$status_reg')";
$result=mysql_db_query($db_member,$sql);
if ($result) {
echo "<h3>¢éÍÁÙŢͧ·èÒ¹ºÑ¹·Ö¡àÃÕºÃéÍÂáÅéÇ</h3>";
echo "<A HREF='register.html'¤ÅÔ¡à¾×èÍà¢éÒÃкº</A>
<BR><BR>";
} else {
echo "<h3>äÁèÊÒÁÒöºÑ¹·Ö¡¢éÍÁÙÅä´é</h3>";
}
mysql_close();
?>
<?
//////////µÃ§¹ÕéäÁèµéͧãªé post ¡çä´é¤Ð¤èÒÁҹФÐ//////////////////////////////
//$name_reg;//ÁѹÁÕ¤èÒáÅéǵ͹àÃÒãÊè¢éÍÁÙÅ
//$name_reg=$_POST[name_reg];
//$surname_reg=$_POST[surname_reg];
//$sex_reg=$_POST[sex_reg];
//$age_reg=$_POST[age_reg];
//$identity_reg=$_POST[identity_reg];
//$addcard_reg=$_POST[address_card_reg];
//$addsick_reg=$_POST[address_sick_reg];
//$telephone_reg=$_POST[telephone_reg];
//$status_reg=$_POST[status_reg];
//$date_reg=date("y-m-d");
if ($name_reg=="" or $surname_reg=="" or $age_reg=="" or
$identity_reg=="" or $addcard_reg=="" or $addsick_reg=="" or
$telephone_reg=="" or $status_reg"") {
echo "<h3>ERROR : ¡ÃسҡÃÍ¡¢éÍÁÙÅãËé¤Ãº</h3>"; exit ( );
}
include "connect.php";
$sql="insert into sick ( ãÊèª×èÍfileld )values (' ' , '$name_reg' , '$surname_reg' , '$sex_reg' , '$age_reg' , '$identity_reg' , '$addcard_reg' , '$addsick_reg' , '$telephone_reg' , '$status_reg')";
$result=mysql_db_query($db_member,$sql);
if ($result) {
echo "<h3>¢éÍÁÙŢͧ·èÒ¹ºÑ¹·Ö¡àÃÕºÃéÍÂáÅéÇ</h3>";
echo "<A HREF='register.html'¤ÅÔ¡à¾×èÍà¢éÒÃкº</A>
<BR><BR>";
} else {
echo "<h3>äÁèÊÒÁÒöºÑ¹·Ö¡¢éÍÁÙÅä´é</h3>";
}
mysql_close();
?>
|
 |
 |
 |
 |
Date :
23 พ.ค. 2549 16:22:59 |
By :
กระแต |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเอาไป run ดูนะ ถ้าไม่ได้เดียวช่วยแก้จ้า
<?
if ($name_reg=="" or $surname_reg=="" or $age_reg=="" or
$identity_reg=="" or $addcard_reg=="" or $addsick_reg=="" or
$telephone_reg=="" or $status_reg"") {
echo "<h3>ERROR : กรุณากรอกข้อมูลให้ครบ</h3>"; exit ( );
}
include "connect.php";
$sql="insert into sick (ใส่ชื่อfieldnam,fieldname,ให้ตรงกับค่านะคะ)
values (' ' , '$name_reg' , '$surname_reg' , '$sex_reg' , '$age_reg' , '$identity_reg' , '$addcard_reg' , '$addsick_reg' , '$telephone_reg' , '$status_reg')";
$result=mysql_db_query($sql);
if ($result) {
echo "<h3>ข้อมูลของท่านบันทึกเรียบร้อยแล้ว</h3>";
echo "<A HREF='register.html'คลิกเพื่อเข้าระบบ</A>
<BR><BR>";
} else {
echo "<h3>ไม่สามารถบันทึกข้อมูลได้</h3>";
}
mysql_close();
?>
|
 |
 |
 |
 |
Date :
23 พ.ค. 2549 16:25:18 |
By :
กระแต |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หรือไม่ก็ลอง echo $sql; ออกมาดูนะครับแล้วเอาcopy ไปrun ใน phpmyadminดู มันจะตรวจให้ในระดับนึ่งว่า error ตรงไหน
|
 |
 |
 |
 |
Date :
23 พ.ค. 2549 22:51:25 |
By :
jankasion |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|