the $sql variable never returns true and I cant figure out why! 8 hours of work now.. Ill buy anyone who solve this a beer! no kidding!
<?php
//lägger till person i persontabellen
$user="mhovmar_todolist";
$password="xxxxx";
$database="mhovmar_todolist";
mysql_connect("mydb3.surftown.se",$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$firstname=$POST['firstname'];
$lastname=$POST['lastname'];
$email=$POST['email'];
$mobile=$POST['mobile'];
$username=$POST['username'];
$losen=$POST['password'];
if(($firstname) && ($lastname) && ($email) && ($mobile) && ($username) && ($losen))
{
$sql = mysql_query("INSERT INTO person (person_id , email , mobile , username , password , firstname , lastname , loggedin , active , lastdatelogin , numberoftodsdone , alertviamail , alertviasms ) VALUES ('', '$email', '$mobile', '$username', '$losen', '$firstname', '$lastname', '0', '1', '0000-00-00', '0', '1', '1')");
if($sql)
{
print " The person has been added to the database.<a href='../mattrock/addperson.html'>insert new person</A> <a href=showevents.php>home</A>";
}
else
{
print "unable do add person";
}
}
else
{
print "All fields has to be filled. Press back on your browser.";
}
?>