Cannot Insert into mysql db.

The $conn is right.
The code is right and the data tables accord with the query and still we cannot INSERT ANY DATA.
Any help appreciated.
We've been at it for two weeks and still NO LUCK!

3 Replies

Did you GRANT the privilege for INSERT on the table to the user that created $conn?


-- sw

We think we solved it

and its called STRICT_TRANS_TABLES! WE DISABLED IT and it seems to help.
unless you know something we dont, which is always more than possible :-))

Please beware: STRICT_TRANS_TABLES can cause data loss in some cases. For example:

Strict mode produces an error for attempts to create a key that exceeds the maximum key length. When strict mode is not enabled, this results in a warning and truncation of the key to the maximum key length.

If this mode is stopping you inserting data, something is wrong with your data, and by disabling this mode, you are potentially hiding a problem with your application.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct