Is this PHP or MySQL Retching on my Keyboard?
Posted: Sat Mar 24, 2007 7:46 pm
feyd | Please use
I would lay the blame at the feet of MySQL, but like I said if I copy in this query to phpMyAdmin (and substitute a studentid in place of $studentid) it executes perfectly.
Appreciate any help.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have this rather lengthy string in my PHP code. When I copy it out of the editor, and paste it into phpMyAdmin, it executes perfectly. On a web page, it constantly retches up bile with this little cutie:
You have an error in your SQL syntax, check the manual for proper syntax near
'.teacher_schedule_termid = grade_terms.grade_terms_id) INNER JOIN grade_subjects' at line 1
And here's the string:Code: Select all
$sSQL="SELECT teacher_schedule_id, grade_terms.grade_terms_desc,
grade_subjects.grade_subject_desc, teacher_schedule_classperiod,
teacher_schedule_id FROM ((teacher_schedule INNER JOIN grade_terms ON
teacher_schedule_termid =
grade_terms_id) INNER JOIN grade_subjects ON teacher_schedule_subjectid =
grade_subject_id) INNER JOIN school_years ON teacher_schedule_year =
school_years.school_years_id
WHERE teacher_schedule_id = ANY(SELECT student_schedule_schedid FROM
student_schedule WHERE student_schedule_studentid =$studentid) ORDER BY
grade_terms.grade_terms_desc,
teacher_schedule.teacher_schedule_classperiod";Appreciate any help.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]