|
|
 |
Re: FN-FORUM: MySQL PHP Query
date posted 21st January 2007 16:20
I think yu have answered the question I was having difficulty establishing
the differecne between defining the values as an array and then looping
through each one within the query or simply hand writing each one, and it
loooks like there is no difference bewtween the two methods without
excessive db work
----- Original Message -----
From: "James Herrington" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Sunday, January 21, 2007 4:29 PM
Subject: Re: FN-FORUM: MySQL PHP Query
>
> I think you might need an OR condition in your select statement. Are you
> trying to find all records where the 'value' field could be one of three
> values declared by you? For example
>
> SELECT supplier_id
> FROM supplier
> WHERE name = 'IBM'
> or name = 'Hewlett Packard'
> or name = 'Gateway';
>
> would find all products where the supplier field is either IBM, Hewlett
> Packard or Gateway. If this is what you want you could use and array as
> follows.
>
>
>
> This may make things a little clearer!
>
> The code is off the top of my head so may not be perfect but should give
> you
> an idea of what needs doing
>
> James
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|