I get this error:
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_resumeAS resume JOIN
_js_job_jobtypesAS jobtype ON resume.jobtype = jobtype.id LEFT JOIN
_js_job_currenciesAS currency ON currency.id = resume.currencyid AND currency.id = LEFT JOIN
_js_job_salaryrangeAS salary ON resume.jobsalaryrange = salary.id ,
_js_job_categoriesAS 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
From this query:
$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;
Anybody any clue? It's a tough one for me!
It says
AND currency.id = LEFT JOIN_js_job_salaryrange AS
So it seems that the variable $currency is not set.
If you add just before the query:$currency = 1;
just to test the query, it might work. You just have to find out what the currency id should be.
Your $currency
variable isn't defined, or evaluates to an empty string. From the error message:
... resume.currencyid AND currency.id = LEFT JOIN_js_job_salaryrangeAS salary ...
^---$currency should be here
Try this query:
SELECT resume.*, cat.cat_title, jobtype.title AS jobtypetitle ,
salary.rangestart, salary.rangeend , currency.symbol
FROM _js_job_categories AS cat, _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
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