fortnox007 Posted October 16, 2010 Share Posted October 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted October 16, 2010 Author Share Posted October 16, 2010 Just to be clear with doubles I mean multiple instances of a user and not the doubles character. Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted October 16, 2010 Author Share Posted October 16, 2010 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.