0

I don't understand why this is happening even though I have classified $verified as a boolean on my bind_param.

    $sql = "INSERT INTO users (user_name, email, verified, token, password) VALUES (?, ?, ?, ?, ?)";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param('ssbss', $username, $email, $verified, $token, $password);
someone
  • 11
  • 3

1 Answers1

1

Given the column name and the error message, I presume the verified column is an integer. However you're binding it as BLOB:

  • i corresponding variable has type integer
  • d corresponding variable has type double
  • s corresponding variable has type string
  • b corresponding variable is a blob and will be sent in packets

Both i and s should work.

(Reference)

Álvaro González
  • 142,137
  • 41
  • 261
  • 360