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?
See:
https://www.mysqltutorial.org/mysql-grant.aspx
-- 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.