I need help with this. I have a database that displays product type titles.
My code so far is:
$query = mysql_query("SELECT type FROM certs ORDER by type") or die("Could not execute query");
while($row = mysql_fetch_array($query) )
{
$product .= "<h1>".$row["type"]."</h1>";
}
echo($product);
which returns
<h1>MR001</h1>
<h1>MR001</h1>
<h1>MR002</h1>
<h1>MR003</h1>
<h1>MR003</h1>
<h1>MR004</h1>
<h1>MR004</h1>
<h1>MR004</h1>
etc., but I need it to only return the same value once?
Like
<h1>MR001</h1>
<h1>MR002</h1>
<h1>MR003</h1>
<h1>MR004</h1>
STUCK.COM HELP!!!
Use DISTINCT in the SQL Query..
Try this: