Errors in form for php
<p>I have been working on this form for my php class. I can not believe I am getting errors left and right. Now I am getting this error:</p>

<p>No database selected
error on table connection </p>

<p>But i check and everything works on my table, here is my code:</p>

<pre><code>if ($_POST['submit']!=""){
if ($_POST['username']==""||$_POST['password1']==""||$_POST['password2']==""||$_POST['firstname']==""||$_POST['lastname']==""||$_POST['address']==""||$_POST['email']==""||$_POST['city']==""||$_POST['state']==""||$_POST['zip']==""||$_POST['phone']=="");
$error=1;
  }
        else if ($_POST['password1']!=$_POST['password2']){
    $error=2;
   }
else{
$hostname="localhost";
$database="Contacts";
$mysql_login="Web_User";
$mysql_password="my1230";

if (!($db = mysql_connect($hostname, $mysql_login , $mysql_password))){
    echo "error on connect";
}
   else{
  if (!(mysql_select_db($databse,$db))){
    echo mysql_error();
    echo "&lt;br&gt;error on table connection";
}
   else{
    $SQL="Insert into tblUsers(username,password,firstname,lastname,email,address,city,state,zip, phone,signupDate)values)'".$_POST['username']."',PASSWORD('".$_POST['password1']."'),'".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['address']."','".$_POST['city']."','".$_POST['state']."','".$_POST['zip']."','".$_POST['phone']."',NOW())";
    mysql_query($SQL);
    if (is_numeric(mysql_insert_id())){
        header("Location:member-content.php?name=".$_POST['username']);
    }
    else{
        echo "Sorry, there was an errot.Please try again ot contact the administrator";
    }
    mysql_close($db);//closeing out connection,done for now
  }
}
</code></pre>

<p>}</p>

<p>?></p>

<p>I haven been sittin here and when I get one thing working the next thing don't work...</p>
