Jump to content

Query works in phpmyadmin but not on page


kirk112

Recommended Posts

Hi,

 

I have the following query, which when I test in phpmyadmin it returns the correct results, but when I use it in the script I get " Unknown column 'score' in 'order clause' " .  Really confusing if it works in phpmyadmin then I presume it should work anywhere but.............

 

SELECT j.job_id, jt.job_title, s.salary, lg.location_name, ls.specific_name, LEFT(jat.advert_text,1000) AS advert, DATE_FORMAT(ja.added_on, '%d-%m-%Y') AS date_added , MATCH(jt.job_title,jat.advert_text) AGAINST ('j\"ood Beverage Managery\"' IN BOOLEAN MODE) AS score FROM jobs AS j LEFT JOIN job_titles AS jt ON jt.job_id = j.job_title LEFT JOIN salary AS s ON s.salary_id = j.salary LEFT JOIN location_general AS lg ON lg.location_id = j.location LEFT JOIN location_specific AS ls ON ls.specific_id = j.location_specific LEFT JOIN job_adverts AS ja ON j.job_id = ja.job_id LEFT JOIN job_adverts_text AS jat ON ja.advert_text_id = jat.advert_text_id LEFT JOIN job_adverts_content AS jac ON ja.how_to_apply_id = jac.content_id LEFT JOIN job_adverts_content AS jac1 ON jac1.content_id = ja.header_id LEFT JOIN job_adverts_content AS jac2 ON jac2.content_id = ja.how_to_apply_id LEFT JOIN job_adverts_content AS jac3 ON jac3.content_id = ja.about_us_id WHERE ja.advert_live = 1 AND MATCH(jt.job_title,jat.advert_text) AGAINST ('j\"ood Beverage Managery\"' IN BOOLEAN MODE) ORDER BY score DESC LIMIT 0, 10

 

Thanks for your help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.