Solved

mysql display unique using php

Posted on 2014-03-12
6
436 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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WooCommerce Sort by Date 4 9
Cart items not showing in header until page refreshed 15 23
Phone Dialer 5 36
sql sentence 2 12
Creating and Managing Databases with phpMyAdmin in cPanel.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now