php - Select between 3 different querys and use the one with results -
good day everyone,
i want know best way select between 3 different querys , use 1 results...
select * table lugar in (1, 2, 3)
or
select * table lugar in (4, 5, 6)
or
select * table lugar in (7, 8, 9, 10)
can use switch operator?
i need more ideas it...
i dont use "if" because query results have use lot of code...
thanks in advance!
mario mata.
you can use this
$var_val="abc"; switch ($var_val) { case "aa": $qry = "select * table lugar in (1, 2, 3)"; break; case "abc": $qry = "select * table lugar in (4, 5, 6)"; break; case "cc": $qry = "select * table lugar in (7, 8, 9,10)"; break; default: $qry = "select * table"; }
Comments
Post a Comment