I recently uploaded a website from my localhost onto webspace. The code on the webspace is working fine but on my localhost I am only able to do SELECT queries; all INSERT queries fail despite the two sets of code being identical. I have checked the permissions in phpMyAdmin and the 'root' user I am logging in with on localhost has all privileges. I cannot figure out why this is happening.
Example. The following code works fine:
mysql_query("SELECT * FROM tbl_note")
but this does not:
mysql_query("INSERT INTO tbl_note(col1, col2) VALUES('$col1', '$col2')") or die("ERROR");
The latter always throws up an error. As I said, the code runs fine my the server but I want to be able to continue development on localhost. I cannot think of anything I have changed to have caused this.