Debt Consolidation - Debt Consolidation - Bob's Free Stuff Forum - Debt Consolidation - IKA Processing Equipment

PDA

View Full Version : when select from mysql remove duplicate names


tastro
Apr 9th 2009, 5:59 am
hi,

also... like said in the title i need a php script that removes duplicate names when reading/select from mysql.

also that it won't output/return/print 2x the same name, for example:

if i have 2x john in my mysql john mclane and john travolta.
but i want only one john to be printed out.

thank you, tastro

Weirfire
Apr 9th 2009, 10:18 am
hi,

also... like said in the title i need a php script that removes duplicate names when reading/select from mysql.

also that it won't output/return/print 2x the same name, for example:

if i have 2x john in my mysql john mclane and john travolta.
but i want only one john to be printed out.

thank you, tastro

I think you're probably looking for

GROUP BY [field name]

where field name is the name of the field that contains names.

matthewrobertbell
Apr 9th 2009, 10:27 am
SELECT DISTINCT(field) ?