Skip to main content
Participating Frequently
November 5, 2009
Question

code check please

  • November 5, 2009
  • 1 reply
  • 267 views

Hi

have a mysql databse which includes colums: UserSex, UserEthnicity,UserAge, UserArea etc.

I've created a form using spry select to search the database for any combination or age, sex ethnicity etc.

When I add four test records to the database and then run the search page in the drop down box  I see (for example) Male female,male female so it's listing the entry for every record.

A google search told me that in the record set I had to use SELECT DISTINCT

so I edited the record set as below

SELECT UserEthnicity, UserAge, UserTypes, UserArea
FROM users

But this hasn't stopped the duplicates.

Is this coding correct?

thanks

Ian

This topic has been closed for replies.

1 reply

jen0dorfAuthor
Participating Frequently
November 5, 2009

Sorry pasted the wrong code

SELECT DISTINCT UserEthnicity, UserAge, UserTypes, UserArea
FROM users

Ian