Jump to content

MySQL Distinct


zero118

Recommended Posts

I know it's not PHP but it's somewhat related.

I'm using the following:
[CODE]        $qry = "SELECT DISTINCT `name` FROM `$parts_database_table`";
        $result2 = mysql_query($qry, $connection);
        $parts = mysql_fetch_row($result2);
[/CODE]
The problem is that I need to get the `id` field of those.  I tried using [I]DISTINCT `name`, `id`[/I] but all it got me was a huge headache.  Please someone help :-(
Link to comment
https://forums.phpfreaks.com/topic/28003-mysql-distinct/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.