Jump to content

Incorrect string type

Go to solution Solved by TechnoDiver,

Recommended Posts

  • Solution

Hi, Phreaks, I'm stuck on something that maybe someone can help with

on trying to send a user information to phpmyadmin I get this error ->


SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xD8,\x08Up\x92...' for column `qcic`.`users`.`salt` at row 1

There's 2 problems here, as you can see. 1) I've got an invalid datetime format. 2) is obviously the incorrect string value on my salt value.

here is the corresponding code ->


if($validation->passed()) {
  $user = new User();
  $salt = Hash::salt(32);

  try {
          "username" => Input::get("usernane"),
          "password" => Hash::make(Input::get("password"), $salt),
          "email" => Input::get("email"),
          "salt" => $salt,
          "signup_date" => date_create('now')->format('Y-m-d H:i:s'),
          "role" => 2,
      $sent = true;
  } catch(Exception $e) {

} else {
  $errors = $validation->errors(); 

It can be seen how I did both of them here. Additionally the Hash::salt method is here ->


public static function salt($length) {
        return random_bytes($length);

the column 'signup_date' is in my database as a datetime not null with 'none' as default.

The column 'salt' is a VARCHAR(32) not null, 'none' as default

Can anyone help me out with what I've done wrong, please. TIA

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.