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
Here's the script
//database connection details
$id =$_REQUEST['id'];
$email =$_REQUEST['email'];
if($email != "")
{
$query = mysql_query("SELECT * FROM $tbl_name WHERE id='$id'");
echo "<table border = 1 cellpadding = 5> <tr> <th> Name </th> <th> Address </th> <th> City </th> <th> State </th> <th> Postal Code </th> <th> Voice </th> <th> Email </th> <th> Status </th> </tr>";
while($row = mysql_fetch_array($query))
{
echo "<tr>";
echo "<td> $row[1] </td>";
echo "<td> $row[2] </td>";
echo "<td> $row[3] </td>";
echo "<td> $row[4] </td>";
echo "<td> $row[5] </td>";
echo "<td> $row[6] </td>";
echo "<td> $row[7] </td>";
echo "<td> $row[8] </td>";
echo "</tr>";
}
echo "</table>";
}
else
echo 'That record does not have an Email';
but i get the error 'Undefined index: email' on running the script..please help