RE: [PHP-DB] moving though an array..
| From: | Aaron Wolski | Date: | Thu, 26 Jun 2003 14:31:27 +0000 |
| Subject: | RE: [PHP-DB] moving though an array.. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28906@lists.php.net to get a copy of this message | ||
Hi Adam,
Thanks...typing errors can be a killer sometimes.
However, the cleared up the "Array" display error but not the displaying
the contents what's in the $columns array.
Thanks for your help!
Aaron
-----Original Message-----
From: Adam Voigt [mailto:adam@cryptocomm.com]
Sent: June 26, 2003 10:26 AM
To: Aaron Wolski
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] moving though an array..
One Thing:
Change $columns[] to $colums, example:
$columns = explode(',',$threadsColumn);
On Thu, 2003-06-26 at 10:23, Aaron Wolski wrote:
> 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
>
--
Adam Voigt (adam@cryptocomm.com)
Linux/Unix Network Administrator
The Cryptocomm Group
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php