Speak People! I have a system that registers products and creates what I need in the data field, however in a crucial part, after I create the fields I need it generates input with these fields! The problem is:
When I send via post the input ta as below
<input type="text" name="campo[]" class="campo_input" placeholder="<?php echo $campo; ?>" />
I need to send the value of this field and separate to insert in the bd, because it is a while!
<?php
include "conecta.php";
mysql_set_charset('utf8');
$lista =$_POST['lista'];
$sku = implode(",", array_map(function ($item) {
return sprintf('"%s"', $item);
}, $_POST['campo']));
$sqli = mysql_query ("INSERT INTO $lista VALUES ('', '".$sku."')") or die(mysql_error());
if($sqli){
echo $sku;
}
else {
echo 'deu erro';
}
?>
It takes legal, but I can not separate to include in the bank, it gives the answer
Column count doesn't match value count at row 1
Just because it takes the answer and does not separate, throw everything in a single column