0

Is it possible to insert multiple values from text into multiple columns seprated by comma.for example i have a table products in which columns are product_name,product_description,lisencekey1, lisencekey2 ,..................and with entering the multiple lisencekeys(only) seprated by comma should be inserted in this fields.

Edited by daniel36: n/a

3
Contributors
2
Replies
7
Views
5 Years
Discussion Span
Last Post by diafol
0

Try this

$arrays = explode(",",$licencekeys);
foreach($arrays as $array) {
echo "Licence Key 1 : $array 
      Licence Key 2 : $array";
}
0

I'm not sure what you're trying to do. Insert license keys into a DB table from a comma delimited string?

$licencekeys="t,d,r";
if($licencekeys !=""){
	$bits = explode(",",$licencekeys);
	for ($x=1;$x<count($bits);$x++){
	  $str[] = "`lisencekey$x` = '{$bits[$x-1]}'";
	}
	$sqlpart = implode(",",$str);
}else{
		$sqlpart = "";
}
//check with: echo $sqlpart;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.