Home > Archive > MySQL Server Forum > June 2005 > working with 'SET'









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author working with 'SET'
Martin Klaffenboeck

2005-06-30, 3:23 am

Hello!

I would like to know how I can work with a PHP Array and a set.

How can i get all rows where a set where at least one item oft the php
Array is inside the set column?

Thanks,
Martin
hoonew

2005-06-30, 9:23 am

Look at the php function implode() and the SQL comparison function expr
IN (...). Probably something like this in php:

$query="SELECT column FROM table WHERE setcolumn IN
(".implode(array,",").")";

which seems like a backwards use of SET type, but...maybe I'm not clear
on what you're trying to do here.

Martin Klaffenboeck wrote:
> Hello!
>
> I would like to know how I can work with a PHP Array and a set.
>
> How can i get all rows where a set where at least one item oft the php
> Array is inside the set column?
>
> Thanks,
> Martin

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com