[SOLVED] CreateInputDropdown make a DISTINCT?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm
Location: Roma, Italy

[SOLVED] CreateInputDropdown make a DISTINCT?

Post by nervino »

Hi All,
I've a recordset with which I create a dropdown list with CreateInputDropdown():

The query is something like:
SELECT * FROM etc.

I forgot to distinct the results (SELECT DISTINCT * FROM etc.)
and with $dbresult>RecordCount() I got 14 records, BUT in the dropdown I have only 9!
I changed the query adding the DISTINCT clause and it correctly returns 9 records.

Does CreateInputDropdown() function make a sort of "distinct"?

thank you
Last edited by nervino on Tue Nov 20, 2012 9:17 am, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: CreateInputDropdown make a DISTINCT?

Post by Jos »

Yes, just take a narrow look at the array you were assigning to the CreateInputDropdown function
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm
Location: Roma, Italy

Re: CreateInputDropdown make a DISTINCT?

Post by nervino »

thanks Jos
Post Reply

Return to “Developers Discussion”