Medoo icon indicating copy to clipboard operation
Medoo copied to clipboard

Insert always works (casts data)

Open safinahmed opened this issue 5 years ago • 1 comments

Describe the bug I have a simple table defined as such CREATE TABLEaccount(user_nameTINYINT(4) NOT NULL,emailDATE NOT NULL ) My code is also simple from the documentation $database->insert("account", [ "user_name" => "foo", "email" => "[email protected]" ]);

I was expecting this to fail as neither user_name nor email fits the datatype defined in the database, but Medoo seems to always be casting (converting) the data types, so I get a row with 0, 0000-00-00 How can I force this to be an error? I've tried adding this to the configuration, but still get success 'option' => [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ]

Information

  • Version of Medoo: 1.7.8
  • Type of Database (MySQL, MSSQL, SQLite...): MySQL
  • System (Liunx\Windows\Mac): Windows
  • PHP: 7.3.12

safinahmed avatar Jan 24 '20 00:01 safinahmed

Hmm. Interesting. Did you figured out why?

harryqt avatar Apr 02 '20 09:04 harryqt