I want to insert an if/else condition inside my sql request. How do I do this? I have tried this below, but it doesn't work:
$QpageManagerGeneralCondition = $OSCOM_PDO->prepare('
select pmd.pages_html_text,
pm.page_general_condition
from :table_pages_manager pm,
:table_pages_manager_description pmd
where
if (pm.customers_group_id = :customers_group_id) else (pm.customers_group_id = 99)
and pm.page_general_condition = 1
and pmd.language_id = :language_id
and pmd.pages_id = pm.pages_id
limit 1
');
$QpageManagerGeneralCondition->bindInt(':language_id',(int)$_SESSION['languages_id'] );
$QpageManagerGeneralCondition->bindInt(':customers_group_id',$OSCOM_Customer->getCustomersGroupID() );
$QpageManagerGeneralCondition->execute();
$QpageManagerGeneralCondition->value('pages_html_text');