Re: MySQL Query
| From: | Ignatius Reilly | Date: | Fri, 25 Oct 2002 12:46:28 +0000 |
| Subject: | Re: MySQL Query | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16553@lists.php.net to get a copy of this message | ||
select * from category_table where catid not in ('2','4')
You have an excellent function index in the MySQL manual. I would recommend
to reading it thoroughly.
HTH
Ignatius
____________________________________________
----- Original Message -----
From: "James Meers" <jambo@venda.com>
To: "Ignatius Reilly" <ignatius.reilly@free.fr>; "PHP Helplist Windows"
<php-windows@lists.php.net>
Sent: Friday, October 25, 2002 2:30 PM
Subject: RE: [PHP-WIN] MySQL Query
> Ok, solved that problem, can anyone help me on my last query, i need to
select categories that are not the following id's, this is what i have:
>
> select * from category_table where catid ! in ('2','4')
>
> Can anyone help me?
>
> James
>
> -----Original Message-----
> From: Ignatius Reilly [mailto:ignatius.reilly@free.fr]
> Sent: Fri 25/10/2002 12:57
> To: James Meers; PHP Helplist Windows
> Cc:
> Subject: Re: [PHP-WIN] MySQL Query
>
>
>
> arrays are not a datatype for MySQL.
>
> You have to serialize your array into a string. You must choose a suitable
> delimitor that will not conflict with your data. Taking as an example ",":
>
> $to_feed = implode( "," , my_array ) ;
>
> $query = " update user_table set categories in '({$to_feed})' where
> userid='1' " ;
>
> HTH
> Ignatius
> ____________________________________________
> ----- Original Message -----
> From: "James Meers" <jambo@venda.com>
> To: "PHP Helplist Windows" <php-windows@lists.php.net>
> Sent: Friday, October 25, 2002 1:39 PM
> Subject: [PHP-WIN] MySQL Query
>
>
> > i want to update a field and add an array, this is what i have so far,
> however it doesnt work, can anyone help?
> >
> > update user_table set categories in ('5','6') where
> > userid='1'
> >
> >
> >
> > James
> >
> >
>
>
>
>