I am trying to get the results of this to come out in table format also to get the email. The email is just a combo of the firstname + Lastname + @gmail. I can't figure it out. This code works but it only prints out the data with a ,.
$output ='';
//collect
if (isset($_POST ['search'])) {
$searchq = $_POST ['search'];
$searchq = preg_replace("#[^0-9a-z]#i","",$searchq);
$query = mysql_query("SELECT * FROM Emp_Dir WHERE FIRST_NAME LIKE '%$searchq%' OR LAST_NAME LIKE '%$searchq%' OR PHONE_NUMBER LIKE '%$searchq%'") or die("could not search!");
$count = mysql_num_rows ($query);
if($count == 0){
$output = 'There was no Search results!';
}else{
while($row = mysql_fetch_array ($query)) {
$FirstName = $row['FIRST_NAME'];
$LastName = $row['LAST_NAME'];
$PhoneNumber = $row['PHONE_NUMBER'];
$Email = $row["FIRST_NAME"+"LAST_NAME"];
$output .= '<div>'.$FirstName.','.$LastName.','.$PhoneNumber.'</div>';
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Search</title>
</head>
<body>
<?php printf ("$output");?>
<table>
</table>
</body>
</html>