Re: [PHP-DB] Multiple values for a column

2004-02-19 Thread Jason Wong
On Friday 20 February 2004 09:14, Shiloh Madsen wrote:
> I need to figure a way to create a table column that will allow for me to
> be able to say "IF column =" and then specify more than a single value. for
> instance, select all from the table where the column in question is either
> 1, 3, 4, and/or 7. 

If you're using MySQL have a look at the IN operator.

> However, I want this column to be able to hold more than
> just a single value. for instance its value would be 1, 4 or something
> similar like that.

If you're using MySQL have a look at the column types SET and ENUM. However in 
general is it better not to store multiple values in a single column, they 
should be moved into a separate table.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Fred noticed his roommate had a black eye upon returning from a dance.
"What happened?"
"I was struck by the beauty of the place."
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Multiple values for a column

2004-02-19 Thread Shiloh Madsen
I need to figure a way to create a table column that will allow for me to be able to 
say "IF column =" and then specify more than a single value. for instance, select all 
from the table where the column in question is either 1, 3, 4, and/or 7. However, I 
want this column to be able to hold more than just a single value. for instance its 
value would be 1, 4 or something similar like that. Is this something that you would 
accomplish with a single column or would you use multiple columns to accomplish this. 
Also, what datatype do you assign do the column if it can be done in one?