i call sql in php script. there no value in "de" if case value "en"
it should not working way
if (exists (select epf_application_detail.description epf_application_detail inner join app_uri on epf_application_detail.application_id=app_uri.application_id app_uri.uri = '/ps-puzzle-daily-download-for-ipad-iphone-327103760.html' , epf_application_detail.language_code = 'de' limit 1)) begin select epf_application_detail.description epf_application_detail inner join app_uri on epf_application_detail.application_id=app_uri.application_id app_uri.uri = '/ps-puzzle-daily-download-for-ipad-iphone-327103760.html' , epf_application_detail.language_code = 'de' limit 1 end else begin select epf_application_detail.description epf_application_detail inner join app_uri on epf_application_detail.application_id=app_uri.application_id app_uri.uri = '/ps-puzzle-daily-download-for-ipad-iphone-327103760.html' , epf_application_detail.language_code = 'en' limit 1 end
i error:
#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'if (exists (select epf_application_detail.description epf_application_detai' @ line 1
here's way,
select d.description epf_application_detail d inner join app_uri on d.application_id = a.application_id a.uri = '/ps-puzzle-daily-download-for-ipad-iphone-327103760.html' order field(d.language_code, 'en', 'de') desc limit 1
if there other languages, might add condition
select .... .... a.uri = '...' , d.language_code in ('en', 'de') order ... limit 1
Comments
Post a Comment