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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -