You should print the output of mysql_error() in order to understand what is going wrong.