title: Listing a row in html table based on a condition
body: <p>I'm trying to list a record from the database based on its id..i have one script that lists all records from the database and displays the records in an html table.in the table, there's one row 'Campaigns' that is a link which when clicked displays only the record of one row..the idea is to list only the row that has an email else display a message saying no email is available</p>
  
  <p>Here's the script</p>
  
  <pre><code>//database connection details
  $id =$_REQUEST['id'];
  $email =$_REQUEST['email'];
  
  if($email != "")
  {
  $query = mysql_query("SELECT * FROM $tbl_name WHERE id='$id'");
  echo "&lt;table border = 1 cellpadding = 5&gt; &lt;tr&gt;   &lt;th&gt; Name &lt;/th&gt; &lt;th&gt; Address &lt;/th&gt; &lt;th&gt; City &lt;/th&gt; &lt;th&gt; State &lt;/th&gt; &lt;th&gt; Postal Code &lt;/th&gt; &lt;th&gt; Voice &lt;/th&gt; &lt;th&gt; Email &lt;/th&gt; &lt;th&gt; Status &lt;/th&gt; &lt;/tr&gt;"; 
  
  while($row = mysql_fetch_array($query)) 
  {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt; $row[1] &lt;/td&gt;";
    echo "&lt;td&gt; $row[2] &lt;/td&gt;";
    echo "&lt;td&gt; $row[3] &lt;/td&gt;";
    echo "&lt;td&gt; $row[4] &lt;/td&gt;";
    echo "&lt;td&gt; $row[5] &lt;/td&gt;";
    echo "&lt;td&gt; $row[6] &lt;/td&gt;";
    echo "&lt;td&gt; $row[7] &lt;/td&gt;";
    echo "&lt;td&gt; $row[8] &lt;/td&gt;";
    echo "&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  }
  else
      echo 'That record does not have an Email';
  </code></pre>
  
  <p>but i get the error 'Undefined index: email' on running the script..please help</p>