 |
|
จะเช็คข้อความที่มีเหมือนกันใน [message] = '".trim($objResult2['message'])."' แล้วนำเวลา rectime มาโชว์ แต่มันกลับโชว์ไม่ครบ ผมลองดูใน DB แล้ว เหมือนถ้ามันมี message ซ้ำ มันจะไม่เอา rectime มาโชว์ครับ ผมสังเกตุว่ามันจะเอาข้อมูล message ที่ไม่ซ้ำกัน นำ rectime มาโชว์ ซึ่ง message อาจส่งไปได้หลาย service_id จึงทำให้บางครั้งในตาราง sms จึงมี message ซ้ำครับ ค่าที่เหมือนกันทั้ง 2 ตารางมีแค่ message นี่ละครับ จะเอาค่าอื่นไปเทียบไม่ได้เลย
Code (PHP)
$strSQL2 = "select [senddate],[message] from history
where service_id = '".$objResult['service_id']."' and DAY(senddate) = 7 and MONTH(senddate) = 11 and
YEAR(senddate) = 2011 and cat_type = '1' and service_id in (16,18,56,263,279,295,334,348,375,381,389,1006,1019,1076,1083,1093,1111,1120,1123,1124,1126,
1128,1129,1134,1143,1201,1202,1204,1205,1206,1207,1216,1227,1229,1244,1251,1261,1262,1263,
1293,1305,1326)
order by [senddate] desc";
$strSQL5 = "select [message],[rectime],[telno] from sms
where day_stamp = 7 and month_stamp = 11 and year_stamp = 2011 and telno = '021234567'
and [message] = '".trim($objResult2['message'])."' ";
Tag : PHP, Ms SQL Server 2008
|
ประวัติการแก้ไข 2011-11-07 15:19:00 2011-11-07 15:19:22
|
 |
 |
 |
 |
Date :
2011-11-07 15:18:24 |
By :
Nos1001 |
View :
918 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |