|
 |
|
แจ้งเตือนข้อมูลซ้ำ...แก้ไขข้อมูลแล้วไม่ให้ข้อมูลซ้ำน่ะค่ะตอนนี้แจ้งเตือนให้แล้วแต่เวลาไปหน้าแก้ไข |
|
 |
|
|
 |
 |
|
เอาแบบง่ายๆนะ
Code (PHP)
<?php
$query="select * from TB_POSITION where position_name = '$_POST[position_name]'";
$sql=mysql_db_query(@config_serverdb,$sql_fetch_query);
$load_topic=mysql_fetch_array($sql_fetch_array)) {
if($num_dup_position_name >= 1)
{
echo "<script>fn_alert(' ชื่อตำแหน่งงานนี้มีแล้ว กรุณากรอกใหม่ค่ะ','".URLBACK."')</script>";
exit();
}
?>
|
 |
 |
 |
 |
Date :
2009-05-31 21:57:27 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โทญทีข้างบนผิดนิดนึง
<?php
$query="select * from TB_POSITION where position_name = '$_POST[position_name]'";
$sql=mysql_db_query(@config_serverdb,$sql_fetch_query);
$num_dup_position_name=mysql_num_rows($sql_fetch_array);
if($num_dup_position_name >= 1)
{
echo "<script>fn_alert(' ชื่อตำแหน่งงานนี้มีแล้ว กรุณากรอกใหม่ค่ะ','".URLBACK."')</script>";
exit();
}
?>
|
 |
 |
 |
 |
Date :
2009-05-31 22:01:06 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เข้าใจแล้ว เวลาแก้ไขน่ะ เพิ่มเงื่อนไขนิดนึง
แนวทางนะ
ถ้า(กดปุ่มแก้ไขจริงและตัวแปลตำแหน่งไม่ได้แก้ไข){
อัพเดทฟิวอื่นยกเว้นฟิว ตำแหน่ง
}
ถ้า(กดปุ่มแก้ไขจริงและตัวแปลตำแหน่งถูกแก้ไขด้วย){
เชคค่าตำแหน่งก่อนว่าซ้ำหรือไม่ ถ้าซ้ำดีดออกและแจ้งเตือน
}
|
 |
 |
 |
 |
Date :
2009-05-31 22:07:56 |
By :
nongjen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|