My code to insert a new users information into my database is like the following:
//Insert information
$query = "INSERT INTO users (userid, username, password, datereg, forumposts, email, name, homepage) VALUES('', '$dusername', '$dpassword', '$date', 0, '$email', '$name', '$homepage')";
$result = mysql_query($query);
//If information is inserted correctly start confirmation
if ($result == '1') {
//Send confirmation e-mail
new_user_mail ($username, $password, $email, $name, $homepage);
//Phrase and print confirmation message
$tpl->parse(NUWELCOME, "nuwelcome");
$tpl->FastPrint(NUWELCOME);
}
//$er = mysql_error();
//If there is a problem inserting the information
else {
$tpl->assign(ERROR, $er);
//Phrase and print template
$tpl->parse(INSERROR, "inserror");
$tpl->FastPrint(INSERROR);
};
My table to store the user info has the following columns from left to right: Userid, username, password, datereg, forumposts, email, name, homepage.
For some reason $result always returns a value of zero (0), or atlest that's what my if statements say. Does anyone have any ideas of what causes this problem?