SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Zaggs's Avatar
    Join Date
    Feb 2005
    Posts
    1,045
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

    PHP Code:
    SELECT users_profile . * , users.first_nameusers.last_nameusers.emailusers.profile_completeks.key_skillsjt.pref_job_titlesc.certifications
    FROM users_profile
    LEFT JOIN 
    (

    SELECT user_idgroup_concatkey_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_idgroup_concatjob_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_idgroup_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 

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    "causing the problem" and "wrong" are not error messages that i am very familiar with, sorry

    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •