Error in bind_param. Data Too long for column

Asked

Viewed 14 times

1

I’m making the following mistake

Error: Data Too long for column 'options' at Row 1

This is my code:

$arr = Array();

foreach($_POST['opcoes'] AS $n=> $m) {
    $p = explode("|", $m);
    $arr[] = $p[1]."-".$_POST['opcoes'][$n];
    $i++;
}
$opcoes = implode(",", $arr);



$rs = $mysqli->prepare("INSERT INTO tabela (nome1,nome2,opcoes) VALUES (?,?,?)");

$rs->bind_param('sss', $_POST['nome1'], $_POST['nome2'], $opcoes);

How to correct this error?

  • 1

    You are in error: Big data for column! Increase column or decrease number of characters.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.