Re: Problems with implode

From: Date: Tue, 24 Mar 2009 13:25:45 +0000
Subject: Re: Problems with implode
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-290642@lists.php.net to get a copy of this message
2009/3/24 Toke Herkild <th@ezl-data.dk>: > Hi All, > > I've an array() with approx 1200 items (list of id-mappings) that part works > fine. > > Now I want to add this list to a query: > $where = "id in (".$idList.")"; > > To accomplish that i do an implode: > $idList = implode(',', $TidList); Are all of the Ids truly numeric? You could try it that way: $sql = "SELECT * from a where x IN('" . implode("', '", $array) . "')" implode string = ', '

« previous php.general (#290642) next »