[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

mysql display unique using php

hello,
I have about 12,000 records inside mysql table and I would select everything and just display the "names" from a Column without duplicates.. how can I do this using php?
0
XK8ER
Asked:
XK8ER
  • 3
  • 3
1 Solution
 
GaryCommented:
SELECT UNIQUE namecolumn,othercolumns FROM table WHERE namecolumn='name'

Open in new window

0
 
XK8ERAuthor Commented:
i dont know the names so how do I do that?
0
 
GaryCommented:
Then remove that part

SELECT UNIQUE column_name,other_columns FROM table

Open in new window

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
XK8ERAuthor Commented:
your code did not work.. but this works


SELECT DISTINCT (stockSymbol ) AS daStock FROM US500 ORDER BY daStock DESC  

Open in new window

0
 
GaryCommented:
Oops wrong database type.
0
 
XK8ERAuthor Commented:
I've requested that this question be deleted for the following reason:

found the answer myself
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now