If you are using MySQL 5.0 or greater on any host I’m sure then you may have encountered an situation where your insert statement does not update your database.
You probably logged into your phpMyAdmin and tested both the generated SQL and PHP insert, and nada. Well here is the reason why:
The SQL statement that is being generated does not have the database prefix. The database prefix is needed when you write your insert statement so that it can execute (at least it occurs this way in GoDaddy MySQL 5.0).
For example, you may be writing
<?php $sql = "INERT INTO `table` (`columnOne`, `columnTwo`) VALUES ('Hi', '$phpVar');" mysql_query($sql); ?>
When you should actually be including the database name before the table name like this:
<?php $sql = "INERT INTO `database`.`table` (`columnOne`, `columnTwo`) VALUES ('Hi', '$phpVar');" mysql_query($sql); ?>
Notice also how I use double quotes for my string instead of single quotes. I recommend that you do this so that if you are passing php variables to the SQL query, you don’t have to use the escape character (i.e. backslash). You can simply write your variable name and enclose it in single quotes.
If you have questions, post.