i need to query list, but i have no idea how to do it. i have six search options, but none are required.
so here is what i'm trying to do
$param1 = "foo";
$param2 = 2;
$param5 = 6;
//...and query shoul be something like this, buti think there is not LIST or LISTGETAT function ..?
$q = "SELECT id FROM table WHERE 1=1 ";
if(isset($param1)) {
$q = $q."AND LIST(params,1) = ".$param1;
}
if(isset($param2)) {
$q = $q."AND LIST(params,2) = ".$param2;
}
if(isset($param5)) {
$q = $q."AND LIST(params,5) = ".$param5;
}
i can use LEFT when params1...n is available but i can't use MID because if know 1,3 ... i don't know length of second parameter