Hi All, Here is what I have to begin with, for example ID | DESC 1 | A 1 | B 2 | C Here's how I would like the output to be like: ID 1: - A - B ID 2: - C Not sure exactly how I would do this with PHP/MYSQL. Ideas would certainly be helpful. Thank you!
You can use 'distinct' keyword to run sql query... I would try to give u rough idea see if it helps : mysql_connect("localhost", "user_name", "password") or die(mysql_error()); mysql_select_db("db_name") or die(mysql_error()); $sql = "SELECT DISTINCT id FROM table_name"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { $sql = "SELECT desc FROM table_name WHERE id = " . $row['id']; $result2 = mysql_query($sql); echo "<strong> ID : " . $row['id'] . "</strong><br/>"; while ($row2=mysql_fetch_assoc($result2)) { echo "-" . $row2['desc'] . "<br/>"; } } Code (markup): Hopefully this should work