|
 |
|
ช่วยดูหน่อยค่ะ insert ไม่ลงฐานข้อมูล ทำฟอร์มข้อมูลบริษัทค่ะ แต่เกิดปัญหาตรงlist box " เลือกประเทศ" |
|
 |
|
|
 |
 |
|
เรายังไม่เห็นโค้ด insert เลยอ่ะ มันอยู่ตรงไหนหรอ
|
 |
 |
 |
 |
Date :
2009-11-11 10:14:55 |
By :
หยก |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเอาคำสั่ง insert มาดูก่อนครับว่าถูกป่าว
|
 |
 |
 |
 |
Date :
2009-11-11 10:41:31 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอ code มาดูหน่อยครับ ให้มาแค่นี้ดูได้ไม่เต็มทีหรอกครับ
|
 |
 |
 |
 |
Date :
2009-11-11 10:45:17 |
By :
aknueng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เวลาเอา code มาดูอ่ะครับเอามาทั้งหน้า หรือ file ที่เกี่ยวข้องอ่ะเอามาโพสไว้เลยนะครับ
เราจะได้ช่วยกันดู แต่อย่างยังไม่เห็นมีตรงไหน insert เลยอ่ะ 
|
 |
 |
 |
 |
Date :
2009-11-11 10:46:15 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แหม่ ย้ำกันจัง 
|
 |
 |
 |
 |
Date :
2009-11-11 10:56:55 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ค่ะๆๆ พอดีเพิ่งมาใหม่และไม่ค่อยรู้ phpค่ะ โทดที แหะๆๆ
นี่ไฟล์ m_add.php ที่เรียกใช้มาค่ะ
Code (PHP)
<?
$field = $value = "";
reset($fieldlist);
while(list(,$s_key) = each($fieldlist))
{
$field .= ", " . $s_key;
$value .= ", '" . $_POST[$s_key] . "'";
}
$field = substr ($field,1, strlen ($field));
$field .= " ,create_date, create_by ";
$value = substr ($value,1, strlen ($value));
$value .= ",'" . date ("Y-m-d H:i:s") . "', '" . $_SESSION["login_name"] . "'";
$sql = "insert into $tbl_name ( " . $field . ") values (". $value . ")";
mysql_query ($sql);
$id = mysql_insert_id ();
//echo $sql;
?>
ส่วนอันนี้เป็นตัวแปรที่ประกาศไว้เรียกใช้ค่ะ
Code (PHP)
<?php
$tbl_name = "company_location";
$PK_field = "company_location_id";
$fieldlist= array('company_id','company_address','province','post_code','country','tel','tel2','fax','employee_qty_this_location','location_description');
?>
|
 |
 |
 |
 |
Date :
2009-11-11 11:59:23 |
By :
piobee |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ง่ะ ไม่มีใครตอบเลยอ่า
|
 |
 |
 |
 |
Date :
2009-11-12 09:22:42 |
By :
piobee |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วค่ะ แหะๆๆ
|
 |
 |
 |
 |
Date :
2009-11-12 11:03:14 |
By :
piobee |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|