title: Can't insert form data into database
body: <p><strong>Answered</strong>
  Well this is interesting. Basically it didn't have to do with what I thought it did. it turns out that the id field on my database was screwed up in some way and it was attempting to enter a second number 0 primary key every time I tried to insert a new row. So I deleted the id column and recreated it making sure to mark it as auto-incrementing and also not entering any data there-in so that it could auto-increment without interruption. Now it seems to be working just fine <em>facepalm</em> </p>
  
  <p>thanks to everyone that gave it a whack though! </p>
  
  <p><strong>UPDATED</strong>
  So the issue with the notice is taken care of. The problem right now is that I'm still stuck with a blank white screen and I have no information actually getting into my database. I have no errors that I can see or think of but it's just not inserting anything into the database. Everyone has told me that I should move do POD or something but I don't have time to start from scratch. if anyone can think of anything that might be causing the white screen after the myriad of changes I've already made I will wet myself XD</p>
  
  <p>I've updated my code to what I have currently running. Any ideas? I'm at the end of my rope T.T</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  
  $hostname = "myHostName";
  $username = "PreRegCustomers";
  $dbname = "PreRegCustomers";
  $password = "myPassword";
  $usertable = "CustomerInfo";
  
  //connect to mysql
  $link_id = mysql_connect($hostname, $username, $password);
  if (!$link_id) {
      die("Unable to connect to database! Please try again later. error:".mysql_errno());
  }
  //make sure DB exists
  if (!mysql_select_db($dbname)) die ("Connected to mysql but could not connect to the DB. error:".mysql_errno());
  
  //avoid sql_injection
  $firstName = mysql_real_escape_string($_POST['firstName']);
  $lastName = mysql_real_escape_string($_POST['lastName']);
  $streetAddress = mysql_real_escape_string($_POST['streetAddress']);
  $city = mysql_real_escape_string($_POST['city']);
  $state = mysql_real_escape_string($_POST['state']);
  $zip = mysql_real_escape_string($_POST['zip']);
  $country = mysql_real_escape_string($_POST['country']);
  $email = mysql_real_escape_string($_POST['email']);
  $phone = mysql_real_escape_string($_POST['phone']);
  $badgeName = mysql_real_escape_string($_POST['badgeName']);
  
  //write the query
  $sql = "INSERT INTO $usertable 
      (firstName, lastName, streetAddress, city, state, zip, country, email, phone, badgeName) 
      VALUES ('$firstName', '$lastName', '$streetAddress', '$city', '$state', '$zip', '$country', '$email', '$phone', '$badgeName')";
  
  //execute the query
  mysql_query($sql); 
  ?&gt;
  </code></pre>
  
  <p>Original Post:</p>
  
  <hr>
  
  <p>So I'm pretty new to php. Like 2 days now and I'm trying to get my web form to insert data into a MySQL database hosted with go daddy. I've tried a bunch of different things, I know php is enabled and working, I have a DNS, I'd been getting the white screen of death but after some changes to my code I'm just getting a notice that says:</p>
  
  <blockquote>
    <p>Notice: Undefined index: country in /home/content/85/11323785/html/devTest/insert2.php on line 26 </p>
  </blockquote>
  
  <p>Now as far as I know, I should be able to ignore a notice except that it's still not inserting anything into my database. I just get a blank white screen with my <code>.php</code> file in the address bar and one notice. </p>
  
  <p>Any help would be stellar! My code is as follows.</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  
  $hostname = "myHostName";
  $username = "PreRegCustomers";
  $dbname = "PreRegCustomers";
  $password = "myPassword";
  $usertable = "CustomerInfo";
  
  //connect to mysql
  $link_id = mysql_connect($hostname, $username, $password);
  if (!$link_id) {
      die("Unable to connect to database! Please try again later. error:".mysql_errno());
  }
  //make sure DB exists
  if (!mysql_select_db($dbname)) die ("Connected to mysql but could not connect to the DB. error:".mysql_errno());
  
  //avoid sql_injection
  $firstName = mysql_real_escape_string($_POST['firstName']);
  $lastName = mysql_real_escape_string($_POST['lastName']);
  $streetAddress = mysql_real_escape_string($_POST['streetAddress']);
  $city = mysql_real_escape_string($_POST['city']);
  $state = mysql_real_escape_string($_POST['state']);
  $zip = mysql_real_escape_string($_POST['zip']);
  $country = mysql_real_escape_string($_POST['country']);
  $email = mysql_real_escape_string($_POST['email']);
  $phone = mysql_real_escape_string($_POST['phone']);
  $badgeName = mysql_real_escape_string($_POST['badgeName']);
  
  //write the query
  $sql = "INSERT INTO $usertable 
      (firstName, lastName, streetAddress, city, state, zip, country, email, phone, badgeName) 
      VALUES ('$firstName', '$lastName', '$streetAddress', '$city', '$state', '$zip', '$country', '$email', '$phone', '$badgeName')";
  
  //execute the query
  mysql_query($sql); 
  ?&gt;
  </code></pre>