group_concat separator question

Hi Guys!

I’m trying to add <li></li> tags around rows that I get from the database. Here’s the query i’m using but it doesn’t work. The left join on the “users_certifications” is the part causing the problem. Is my sql wrong?


SELECT users_profile . * , users.first_name, users.last_name, users.email, users.profile_complete, ks.key_skills, jt.pref_job_titles, c.certifications
FROM users_profile
LEFT JOIN (

SELECT user_id, group_concat( key_skill
SEPARATOR ', ' ) AS key_skills
FROM users_key_skills
GROUP BY user_id
) AS ks ON ks.user_id = users_profile.user_id
LEFT JOIN (

SELECT user_id, group_concat( job_title
SEPARATOR ', ' ) AS pref_job_titles
FROM users_pref_job_titles
GROUP BY user_id
) AS jt ON jt.user_id = users_profile.user_id
LEFT JOIN (

SELECT user_id, group_concat( '<li>', certification,
SEPARATOR '</li>' ) AS certifications
FROM users_certifications
GROUP BY user_id
) AS c ON c.user_id = users_profile.user_id
INNER JOIN users ON users.id = users_profile.user_id
WHERE users_profile.user_id = '1'
LIMIT 0 , 30

“causing the problem” and “wrong” are not error messages that i am very familiar with, sorry

:slight_smile: