title: Undefined Index - Even with Isset If statement
body: <p>Can anyone tell me why I am getting an Undefined Index error on my code here.
  I have used this setup using the if(isset) condition in other parts of my project after
  researching my original Undefined Index errors and ISSET fixed my problems. But it is not working here for some reason and I cannot see why.</p>
  
  <p>This form is POSTING the input:</p>
  
  <pre><code>&lt;form action="addAlbum_Processed.php" method="POST"&gt;
  &lt;p&gt;Enter artistID of Artist&lt;input type="number" name="artist_id" maxlength="2" size="2"&gt;&lt;/p&gt;
  &lt;p&gt;Enter name of Album to be created&lt;input type="text" name="album_name" size="20"&gt;&lt;/p&gt;
  &lt;input type="submit" name="submit" value="submit"&gt;&lt;/form&gt;
  </code></pre>
  
  <p>and this page is processing the form input and updating the albums table in my database:</p>
  
  <pre><code>&lt;?php    
  
  $connection = mysql_connect('localhost','root','')              
  or die(mysql_error());
  echo "Connected to php Server &lt;br&gt;";   
  
  
  or die("Could not select assi2 database");
  echo "Connected to assi2 database &lt;br&gt;";
  
  
  if(isset($_POST['submit']))
  {
  $album_name = $_POST['album_name'];
  $artist_id = $_POST['artist_id'];
  }
  
  $album_name = $_POST['album_name'];
  $artist_id = $_POST['artist_id'];
  
  $sqlQuery = "SELECT * FROM albums WHERE album = '{$album_name}'";
  
  $result = mysql_query($sqlQuery, $connection) or die("Selection Query Failed !!!");
  
  if (mysql_num_rows($result) != 0)        
  {
      header ("Location: Album_Exists.html");
  }
  
  else
  {
      $sqlInsert = "INSERT INTO albums (ArtistID, Album, delete_marker) 
                    VALUES ('{$artist_id}','{$album_name}','delete_marker = 0')";
  
      $result = mysql_query($sqlInsert, $connection) or die("Selection Query     Failed !!!");
  
      header ("Location: addAlbum_Processed.php");
  }
  
  
  mysql_close($connection);
  
  ?&gt;
  </code></pre>
  
  <p>I cannot see where I am going wrong. Regards, TW</p>