I have a database table from which, when I select data with username and password, it works but when I insert some data in that table with same username and password it shows me the error
INSERT command denied to user 'username'@'localhost' for table 'tablename'
I searched using Google and someone else had the same problem with db size. I checked my db and when I go directly to phpmyadmin to insert data into the table, it works, but when I call a query to the table from a PHP script, it gives me the error.
I had a similar problem after moving my site from one hosting account to another. The problem was caused by a SQL query (INSERT
) that referenced the old database. replacing the old db with the new db name (or just removing the db name altogether) solved the problem. But this mistake stumped the support people at my hosting company.
Example:
INSERT INTO old_db_name.table_name ( ) VALUES ();
Changed to:
INSERT INTO new_db_name.table_name ( ) VALUES ( );
Hope this helps and makes sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With