I am very new to php and was wondering if somebody would like to weigh in on this one. I'm almost there, but after 3 days I've almost give up :(. I have a table that I that has email address, names and phone #'s. If the person does not have an email address, I would just like the code to print out the name and address with the email link. Sounds simple until I tried to do it :)
Here is my almost working code: (I have a connection already - I works fine as long as I take away trying to eliminate removing the email link part.) Thanks in advance for your time.
<?php
$data = mysql_query("SELECT first,last,email,phone FROM church_staff WHERE
display='yes' AND pull_justice='yes' ORDER BY last ASC")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
Print " <tr><td class=\"low\"> ";
// Evaluates to true because $email is empty
if (empty($email)) {
Print " ".$info['first']." ".$info['last']." ";
}
// Evaluates as true because $email is set
if (isset($email)) {
}
Print " <img src=\"images/email.gif\" alt=\"email\">
<a href=\"mailto:".$info['email']." >".$info['first']." ".$info['last']."</a> ";
Print " </td><td class=\"low\">".$info['phone']."</td></tr> ";
?>