IF in prefilter query

merlino68

Member
you can put the if condition in the pre-filter a list?
the query that I work but I wish, if the field id_joomla_ins = 0 the value must not be {$ q-> id_joomla_ins} but the {$ q-> id_joomla} present in the same table.

Query
SELECT id_joomla_ins FROM login_tm_pay WHERE id_joomla = {$my->id}

thanks for help
 

Attachments

  • list.jpg
    list.jpg
    214.3 KB · Views: 104
Never tried it, but I would assume you can put the if in your sql
Code:
SELECT IF(`id_joomla_ins` = 0,`id_joomla`,`id_joomla_ins`) FROM login_tm_pay WHERE id_joomla = {$my->id}
 
this work
SELECT IF(`id_joomla_ins` = 0,`id_joomla`,`id_joomla_ins`) as id_joomla_ok FROM login_tm_pay WHERE id_joomla = {$my->id}

in valore
{$q->id_joomla_ok}

;););)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top