|
 |
|
พี่ๆๆค่ะ ช่วยดูโค้ดเกี่ยวกับเรื่องค้นหาให้หน่อยค่ะ ว่าผิดตรงไหน มีปัญหาอีกแล้วค่ะ |
|
 |
|
|
 |
 |
|
$strsql = $strsql." and scho_year like = '%$_POST[skey1]%' ";
ที่ทำตัวหนาไว้ให้ ดูดีๆ
|
 |
 |
 |
 |
Date :
2009-11-08 17:48:58 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอา = ออก หรอค่ะ ไม่ได้อยู่ดีค่ะ ลองแล้ว
ช่วยหน่อยนะค่ะ
ค้นแต่ชื่อได้
แต่ค้นปีการศึกษาไม่ได้
|
 |
 |
 |
 |
Date :
2009-11-08 18:14:27 |
By :
my_bebe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปีเก็บยังไง เป็น datetime หรือ varchar
|
 |
 |
 |
 |
Date :
2009-11-08 18:33:16 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
varchar ค่ะ
|
 |
 |
 |
 |
Date :
2009-11-08 19:05:54 |
By :
my_bebe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่รู้ว่าเขียนอย่างนี้จะได้เปล่า 
$strsql = $strsql ." and scho_year like '%" .$_POST[skey1] ."%' ";
|
 |
 |
 |
 |
Date :
2009-11-08 19:22:47 |
By :
onizike |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
echo $strsql ออกมาดูครับว่ามันเป็นยังไง
|
 |
 |
 |
 |
Date :
2009-11-08 19:41:38 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำตามที่คุณ onizike บอก็ยังไม่ได้ค่ะ ทำไงดีง่ะ 
|
 |
 |
 |
 |
Date :
2009-11-08 20:23:35 |
By :
my_bebe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
echo $strsql ออกมาดู มันเป็นแบบนี้ค่ะ
select * from p_scholar where scho_name <> ''
อันนี้ตอนค้นหาปี 2552 แล้วหาไม่เจอ ไม่ว่าค้นปีอะไรก้อไม่เจอ
select * from p_scholar where scho_name <> '' and scho_year like '%2552%
|
 |
 |
 |
 |
Date :
2009-11-08 20:26:40 |
By :
my_bebe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แน่ใจว่าเป็น varchar ถ้าใช่มันน่าจะเจอนะ หรือว่าเก็บเป็น 2009 หรือเปล่า
|
 |
 |
 |
 |
Date :
2009-11-08 20:54:41 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่อ ได้แล้วค่ะ เก็บเป็น 2009 นี่เอง อิอิ
ขอบคุณมากค่ะ
|
 |
 |
 |
 |
Date :
2009-11-08 22:57:30 |
By :
ฺฺBetagen |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$strsql = $strsql." and '%$_POST[skey1]%' between g_start and g_end like ";
ผิดตรงนี้ครับ แต่ผมเองก็ไม่สามารถเดาได้ว่าที่ถูกต้อง ต้องทำยังไง 
|
 |
 |
 |
 |
Date :
2009-11-10 00:22:47 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|