I have a php file with this line of code (among others):
$sql = "INSERT INTO psa ( id , name , imageurl , websiteurl , email , content )
VALUES ( '', '$f_name', '$f_imageurl', '$f_websiteurl', '$f_email', '$f_indhold' );";
The problem is that this line doesn't generate an error, but nothing is put inside the database either. I did check the variables and they do contain text/values.. (and "id" is auto_increment).
Also you have to make sure that the data your inserting is ok for the field... i.e. your not trying to insert text into a numerical field... also try checking that
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
to do that, use:
if (!$sql){
echo mysql_error();
}
and as pete said, if it's a query, it needs mysql_query in front of it, unless you do it like steve does (2+ lines)
Also, if you do it the pete way, you need to make sure that all the values are in the correct table order, with any gaps inbetween filled with null, or something, otherwise it won't work.