hi:

I have 2 tables, lesson and lesson_gle, where lesson
holds lesson data and lesson_gle holds repeating data
that are how the lesson correlates to various state
standards (one lesson can have many
correlations)...one particular lesson may have a math
correlation as well as a language arts correlation.

>From a couple of popups, I am passing numerical values
for $level and $subject which pertain to a certain
level (grade level) and subject (the correlations). I
am decoding them using an array which I use to
construct the query you see below.

The query is working fine, HOWEVER, it only looks at
the first correlation of a lesson...so if I ask for
math, all of the lessons that have math as a second
correlation are not returned, and I would like to be
able to show ALL lessons that have a "MA" correlation.

SELECT *
FROM lesson, lesson_gle 
WHERE lesson.l_id = lesson_gle.l_id 
$cluster[$level]
GROUP BY lesson.l_id 
HAVING lesson_gle.glenum LIKE '$subjaray[$subject]%' 
ORDER BY lesson.l_id

$cluster = array (" ", "AND (lesson.grdlevel = '1' OR
lesson.grdlevel = '2')", "AND (lesson.grdlevel = '3'
OR lesson.grdlevel = '4' OR lesson.grdlevel = '5')",
"AND (lesson.grdlevel = '6' OR lesson.grdlevel = '7'
OR lesson.grdlevel = '8')", "AND (lesson.grdlevel =
'9' OR lesson.grdlevel = '10' OR lesson.grdlevel =
'11' or lesson.grdlevel = '12')");

$subjaray = array ("", "LA", "MA", "SS", "SC", "AT",
"VA", "PE", "TH", "MU", "HE", "DA", "FL");

Thanks

Luis




__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to