moving though an array..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,
 
Hopefully someone here can point me in the right direction.
 
I need to create a SELECT statement based on some criteria select and
entered into a form.
 
Form variables:
 
$threadsColumn = "manufactuer,colour";
$string = "n";
 
Code:
 
            $columns[] = explode(",",$threadsColumn);
 
            $test = "(";
 
            for ($i=0;$i<sizeof($columns);$i++) {
 
                        $test .= $columns[$i]." %$string%";
 
            }
 
            $test .= ")";
 
            echo $test;
 
What I am attempting to do is create a select statement that would look
like (based on "form variables"):
 
SELECT * FROM tablename WHERE (manufacturer LIKE %n% OR colour LIKE %n%)
 
The information between ( and ) needs to be written in such a manner
that it scales up or down in options.. depending on what was selected in
the form.
 
ANYONE have some thoughts?
 
Oh.. when I echo the above code I get this: (Array %h%)
 
Thanks!
 
Aaron 
 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux