Re: Problem with implode() function

From: Date: Tue, 16 Jul 2002 16:23:46 +0000
Subject: Re: Problem with implode() function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-107920@lists.php.net to get a copy of this message
> I have an array of elements which are separated with the operator > comma(,). > > ================================================== > $array = implode(",", $checkb); > > echo $array.'\n'; > > $result = mysql_query("DELETE FROM temp WHERE inv_tag IN > ($array)") or die('Error in query'.mysql_error()); > ==================================================== > > > PTX526_P_1,SIM_1 > > Error in query Unknown column 'PTX526_P_1' in 'where clause'. > Use quotes around string..otherwise MySQL things your telling it a column name. $array = "'" . implode("','",$checkb) . "'"; ---John Holmes...

« previous php.general (#107920) next »