|
 |
|
ช่วย แก้ปัญหาผมทีครับ select เท่าไหร่ก็ไม่ยอมออก คือผม ใช้คำสั่ง select แล้วข้อมูลที่ผมเรียกให้มันแสดง มันไม่ยอมออกอ่ะครับ |
|
 |
|
|
 |
 |
|
คือผม ใช้คำสั่ง select แล้วข้อมูลที่ผมเรียกให้มันแสดง มันไม่ยอมออกอ่ะครับ ช่วยผมทีครับ
SELECT branch.branch_thai,branch.branch_eng,branch.id_branch,course.id_branch,course.degree_thai,course.degree_eng,
course.id_course,stuctare_course.id_course,course.abridge_thai,course.abridge_eng,course.object,course.philosophy,course.course_year,
course.`status`,stuctare_course.id_stuctare_course,course_plan.id_stactare_course,course_plan.id_subject,subject.id_subject,
stuctare_course.amoantcredit,course_plan.`year`,subject.subject_thai,subject.subject_eng,subject.definition_compel
FROM
course
INNER JOIN branch ON (course.id_branch = branch.id_branch)
INNER JOIN stuctare_course ON (course.id_course = stuctare_course.id_course)
INNER JOIN course_plan ON (stuctare_course.id_stuctare_course = course_plan.id_stactare_course)
INNER JOIN subject ON (course_plan.id_subject = subject.id_subject)
where branch.id_branch = '$_POST[id_branch]' ";
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-08-29 17:22:10 |
By :
thirawood |
View :
1048 |
Reply :
14 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
join กันมันเลยนะครับ
ก่อนอื่นเช็คตัวแปร $_POST[id_branch] หรือยังครับว่ามีค่าหรือเปล่า
|
 |
 |
 |
 |
Date :
2009-08-29 17:46:18 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอ้โห
|
 |
 |
 |
 |
Date :
2009-08-29 18:25:43 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
id_branch มีข้อมูลแล้วนะครับ คือ ผมต้องการเปรียบเทียบข้อมูลหลักสูตรอ่ะครับ
เลยต้อง join ตารางกัน ถึง5ตารางที่มีส่วนเกี่ยวข้อง แต่คือมันออกมาแค่ หลักสูตรเดี่ยว
ข้อมูลในตารางที่เกี่ยวข้อง มันมีข้อมูลหมดเลยนะครับ
|
 |
 |
 |
 |
Date :
2009-08-29 18:31:42 |
By :
thirawood |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันตรวจสอบยากอะครับ เพราะว่าผมไม่รู้ว่าข้อมูลคุณมีอะไรอยู่บ้าง ช่วยส่ง export database ส่งมาให้ผมดูได้หรือป่าวครับ
[email protected] เด่วว่างๆ จะดูให้นะครับ
|
 |
 |
 |
 |
Date :
2009-08-29 18:46:08 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ส่งไปให้ทางเมล์แล้วนะครับ
|
 |
 |
 |
 |
Date :
2009-08-29 18:58:21 |
By :
thirawood |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ข้อมูลในตาราง บางตารางมันมี row เดียวนิครับ อย่างเช่น ตาราง subject คุณ join เอาเฉพาะที่มี course_plan.id_subject = subject.id_subject
แบบนี้ INNER JOIN subject ON (course_plan.id_subject = subject.id_subject) มันก็ออกมา row เดียวถูกต้องแล้วนิครับ
|
 |
 |
 |
 |
Date :
2009-08-29 23:07:54 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไล่ซะ มึน เลย  
|
 |
 |
 |
 |
Date :
2009-08-29 23:38:31 |
By :
ariya99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมจะทำการ Debug ทีละTableครับ
เช่นเริ่มจาก course,branch ก่อนว่ามีข้อมูลออกหรือป่าว
แล้วค่อย Join stuctare_course ไปเรื่อย ๆ ครับ
จนครบ แล้วเราจะหาเจอครับว่าตัวไหนที่มีปัญหาอยู่
ถ้าเกิดว่า Join ทั้งหมดแล้ว มีข้อมูลหมด
ก็แปลว่า เป็นที่ตัวแปรที่ส่งเข้ามาค้นหาแล้วละครับ
ลองดูนะครับ
|
 |
 |
 |
 |
Date :
2009-08-31 08:38:10 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอขอบทุกๆ คุณท่าน ที่มาให้ให้คำแนะนำนะครับ ตอนนี้ผมแก้ไขได้แล้วครับ
ไว้ครั้งหน้า เจอปัญหา จะมาระกวนทุกท่านอีกนะครับ
มือใหม่หัด PHP
|
 |
 |
 |
 |
Date :
2009-08-31 18:10:07 |
By :
thirawood |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยินดีครับ ขอให้สนุกกับการเขียน php นะครับ
|
 |
 |
 |
 |
Date :
2009-08-31 18:47:24 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอโทษนะคะหนูช่วยแก้ไขปัญหาไม่ได้หนูก็มีปัญหาของหนูเหมือนกันคือหนูเป็นเด็ก10ขวบมีเพื่อนบ้านอายุ7ขวบซึ่งเพื่อนบ้านเป็นคนแย่งความรักจากแม่ไป
|
 |
 |
 |
 |
Date :
2009-09-27 17:51:58 |
By :
แก้ม |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อารายหง่า งง เรยยยยย
|
 |
 |
 |
 |
Date :
2009-09-27 20:52:45 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
555555555
ซะงั้น
|
 |
 |
 |
 |
Date :
2009-09-28 09:06:07 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อยากลบ แต่เห็นจาย สงสายม่ายมีที่ระบาย 
|
 |
 |
 |
 |
Date :
2009-09-28 09:30:55 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|