Jump to content

select different srts of values


fortnox007

Recommended Posts

Hi all i have 2 small questions and maybe someone could help me out.

Say I have a database with a table 'users'.

This table has fields: email, name and year.

 

What I want to do is show at the front-end all users, by selecting them from the table, and arrange them by year in column 1 and show them as individuals in column 2. But here is the thing; if someone selects for instance year 1970 and also someone from 1970 individually, someone will be selected twice. (edit:As a side note the selecting is aimed and emailing the users, that's why selecting someone twice is not good :)

First question is: does anyone know how to remove doubles (maybe even triples if there is a select all button, maybe turn this around and say select only 1 instance of a user).

 

Second question: is this a wise way to let someone select. Right now all users are fetched, and if the table users grows this could be tricky because of the large number of users.

 

If someone could point me in the right direction of thinking I would be very happy, been thinking about this and scalability for quite a while now  ;D

 

Link to comment
https://forums.phpfreaks.com/topic/216012-select-different-srts-of-values/
Share on other sites

OK I answered the first question myself (with array_unique,  i was looking for something called array_duplicate),

 

Anyway if someone could still have a look at the second question I have I would be more than pleased.

Cheers! :-*

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.