我收到此错误:


  1064 You have an error in your SQL syntax; AS salary ON resume.jobsalaryrange = salary.id ' at line 6 SQL=SELECT resume.*, cat.cat_title, jobtype.title AS jobtypetitle , salary.rangestart, salary.rangeend , currency.symbol FROM _js_job_resume AS resume JOIN _js_job_jobtypes AS jobtype ON resume.jobtype = jobtype.id LEFT JOIN _js_job_currencies AS currency ON currency.id = resume.currencyid AND currency.id = LEFT JOIN _js_job_salaryrange AS salary ON resume.jobsalaryrange = salary.id , _js_job_categories AS cat WHERE resume.job_category = cat.id AND resume.status = 1 AND resume.searchable = 1 AND resume.nationality = 'KE' AND resume.iamavailable = 20 AND resume.jobtype = 2


从此查询:

    $db->setQuery($query);
    $total = $db->loadResult();

    if ( $total <= $limitstart ) $limitstart = 0;
    $query = "SELECT resume.*, cat.cat_title, jobtype.title AS jobtypetitle
            , salary.rangestart, salary.rangeend , currency.symbol
            FROM `#__js_job_resume` AS resume
            JOIN `#__js_job_jobtypes` AS jobtype ON resume.jobtype = jobtype.id
            LEFT JOIN `#__js_job_currencies` AS currency ON currency.id = resume.currencyid     AND currency.id =  " .$currency."
            LEFT JOIN `#__js_job_salaryrange` AS salary ON resume.jobsalaryrange = salary.id
            , `#__js_job_categories` AS cat ";
        $query .= "WHERE resume.job_category = cat.id AND resume.status = 1 AND resume.searchable = 1";
    $query .= $wherequery;


有人有线索吗?
对我来说这是一个艰难的过程!

最佳答案

它说

AND currency.id = LEFT JOIN_js_job_salaryrange AS


因此,似乎未设置变量$ currency。

如果仅在查询之前添加:$currency = 1;仅用于测试查询,则它可能会起作用。您只需要找出货币ID应该是什么即可。

关于php - 1064 mySQL错误:在第6行中AS工资在resume.jobsalaryrange =工资.id',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22105136/

10-11 07:50