Avatar of JPERKS1985
JPERKS1985
 asked on

For each unique user in mysql table echo

I need php code and sql code to echo each unique user within a table. The field name is user. I'm just looking for SQL syntax and php code if needed.
PHPSQL

Avatar of undefined
Last Comment
Guy Hengel [angelIII / a3]

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Robin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Guy Hengel [angelIII / a3]

here we go:
<?php
 mysql_connect(....);
 mysql_select_db(...); 
 $query = "select `name` from yourtable group by `name` ";
 $rows = mysql_query($query);
 while ($row = mysql_fetch_assoc($rows))
 {
   print "{$row['name']}<br>";
 } 
?>

Open in new window

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck