 |
ใครก็ได้ช่วย แก้ query sql ให้ทีครับ ปัญหาคือ ทำไมมัน order by chapter_id มาให้ละครับ ผมไม่ต้องการให้มัน order by แต่ต้องการให้มัน เรียง chapter_id |
|
 |
|
|
 |
 |
|
จาก sql
sql=>SELECT chapter_id, score FROM track_student_progress WHERE user_id=850 AND course_id=41 AND chapter_id in (1108,1074,1075,1076,1077,1082,1080,1081,1109) AND outline_id=9
จากนั้นผมทำการ db_fetch_array
output ที่ได้
[score=0 , shapter=1074]
[score=0 , shapter=1075]
[score=0 , shapter=1076]
[score=0 , shapter=1077]
[score=0 , shapter=1080]
[score=0 , shapter=1081]
[score=0 , shapter=1082]
[score=9 , shapter=1108]
[score=9 , shapter=1109]
ปัญหาคือ ทำไมมัน order by chapter_id มาให้ละครับ ผมไม่ต้องการให้มัน order by แต่ต้องการให้มัน
เรียง chapter_id ตาม chapter_id in (1108,1074,1075,1076,1077,1082,1080,1081,1109)ตามที่ส่งเป็น array ไป ผมใช้ msql 2000
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2010-06-23 10:26:24 |
By :
jetaped |
View :
967 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code
SELECT chapter_id, score FROM track_student_progress WHERE user_id=850 AND course_id=41 AND chapter_id in (1108,1074,1075,1076,1077,1082,1080,1081,1109) AND outline_id=9
Code
ปัญหาคือ ทำไมมัน order by chapter_id มาให้ละครับ
เหมือนจะรู้นิว่าต้องทำยังไง
Code
SELECT chapter_id, score FROM track_student_progress WHERE user_id=850 AND course_id=41 AND chapter_id in (1108,1074,1075,1076,1077,1082,1080,1081,1109) AND outline_id=9 order by chapter_id
|
 |
 |
 |
 |
Date :
2010-06-23 14:59:22 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|