There must be problem with ur sql query.
try this
Insert in $table_name (field1,field2) Values (\"$value1\",\$value2\");
I hade the same problem, it got solved after i entered the values in this format.
If this does not solve ur problem then check your mysql table and see what have u entered in the type of values (varchar/char/int)