[thelist] [PHP/MySQL] building a select statement from a mutilple select field

Kasimir K evolt at kasimir-k.fi
Mon Aug 1 03:16:32 CDT 2005


> $cities = array('Biloxi','Diamondhead','Gulfport','Lakeshore');
> 
> $sql = "(".implode(",",$cities).")";

One little thing: remember to include quotes, like this:

$sql = "('" . implode("','" , $cities) . "')";

.k


More information about the thelist mailing list