I am trying to select distinct last names (lname) and if there are duplicate people with the same last name to have them be redirected to a new page.
I cannot get the redirect to work.
[code=php]$query = “SELECT count(‘lname’) AS ‘count’ FROM cle_signup WHERE (SELECT DISTINCT lname FROM cle_signup WHERE lname=’$trimmed’)”;
$result = mysql_query($query) or die(“Couldn’t execute query: “.mysql_error());
while ($rows=mysql_fetch_array($result)){
$name = “<br /><p class=”subheadblue”>$rows[fname] $rows[lname]</p>”;
$total=$rows[‘count’];
if ($total > 1) {
echo ‘<p class=”subheadblue”><a href=”calculator2.php?name=’.$rows[‘fname’].’,’.$rows[‘lname’].'”>’;
echo “$name</a></p>”;
} else {
echo ‘<meta http-equiv=”refresh” content=”0;url=calculator3.php?name=’.$rows[‘lname’].'”>’;
}
}