Hello,
I have a Mysql database that has user names, phone numbers and email addresses, location etc.
eg
John Smith | 333-3434 | jsmith@aol.com | Denver
mary smith | 343-2232 | msmith@aol.com |Chicago
I run a query that returns users information based on their location.
So:
?>
$sql = "Select Full_Name, Location, Phone, Email from table where full_name like '%$name%' order by Last_Name";
?>
I put that into an array:
<?
$result = mysql_query($sql);
for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
{
$fullname=$row[0]; //puts results into variables
$location=$row[1];
$Phone=$row[2];
$Email=$row[3];
//prints out variables
print '<table border = "1">';
print '<tr>';
print '<td width = "2%" align = "left"> <font size="2"><b>'.$fullname.'</font></td> ' ;
print '<td width = "1%" align = "center"> <font size="2"><b>'.$location .'</font></td> ';
print '<td width = "1%" align = "center"> <font size="2"><b>'.$phone .'</font></td> ';
print '<td width = "3%" align = "center"> <font size="2"><'.$email .'</font></td>';
print '</tr>';
print '</table>';
}
?>
This is all fine and good but I want to turn the email address into a hyperlink for that email address.
I tried:
.....
<?
print '<td width = "3%" align = "center"> <font size="2"><a href ="mailto:'.$email .'"></a></font></td>';
?>
.....
but that doesnt work. Can this be done />
Thank you.
I have a Mysql database that has user names, phone numbers and email addresses, location etc.
eg
John Smith | 333-3434 | jsmith@aol.com | Denver
mary smith | 343-2232 | msmith@aol.com |Chicago
I run a query that returns users information based on their location.
So:
?>
$sql = "Select Full_Name, Location, Phone, Email from table where full_name like '%$name%' order by Last_Name";
?>
I put that into an array:
<?
$result = mysql_query($sql);
for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
{
$fullname=$row[0]; //puts results into variables
$location=$row[1];
$Phone=$row[2];
$Email=$row[3];
//prints out variables
print '<table border = "1">';
print '<tr>';
print '<td width = "2%" align = "left"> <font size="2"><b>'.$fullname.'</font></td> ' ;
print '<td width = "1%" align = "center"> <font size="2"><b>'.$location .'</font></td> ';
print '<td width = "1%" align = "center"> <font size="2"><b>'.$phone .'</font></td> ';
print '<td width = "3%" align = "center"> <font size="2"><'.$email .'</font></td>';
print '</tr>';
print '</table>';
}
?>
This is all fine and good but I want to turn the email address into a hyperlink for that email address.
I tried:
.....
<?
print '<td width = "3%" align = "center"> <font size="2"><a href ="mailto:'.$email .'"></a></font></td>';
?>
.....
but that doesnt work. Can this be done />
Thank you.