Solved

mysql display unique using php

Posted on 2014-03-12
6
441 Views
Last Modified: 2014-03-12
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
Comment
Question by:XK8ER
  • 3
  • 3
6 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39923821
SELECT UNIQUE namecolumn,othercolumns FROM table WHERE namecolumn='name'

Open in new window

0
 
LVL 1

Author Comment

by:XK8ER
ID: 39923872
i dont know the names so how do I do that?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39923875
Then remove that part

SELECT UNIQUE column_name,other_columns FROM table

Open in new window

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 1

Author Comment

by:XK8ER
ID: 39923881
your code did not work.. but this works


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

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
ID: 39923903
Oops wrong database type.
0
 
LVL 1

Author Comment

by:XK8ER
ID: 39924565
I've requested that this question be deleted for the following reason:

found the answer myself
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question