0
Speak People! I have a system that registers products and creates what I need in the data field, but in a crucial part, after I create the fields I need it generates input with these fields! the problem is:
When sending via post the input is 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 comic, because it is in 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';
}
?>
he takes it nice, but I can’t separate to include in the bank, he gives the answer
Column count doesn't match value count at row 1
precisely because it takes the answer and does not separate, plays everything in a single column
perfect! thank you!
– Evandro Aguiar