php - SQL find which OR was matched -


in statement like: select * tbl1 row1=val1 or row2=val2, possible know row matched? if how done? , how capture in php?

use case/if statement

select *,        case when row1='val1' 'row1' else 'row2' end matched col tbl1 row1='val1' or row2='val2' 

case statement can replaced if statement this

if(row1='val1','row1','row2') 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -