Distinct record / Help Please!

Distinct record

i don'w know how to select only distinct record by a field let's say 'date'. maybe this $sessions = $sessions→unique()? but i don't know exactly how to use it. my date field is not a unique field. i want a select like this: SELECT DISTINCT column_name(s) FROM table_name. i want select only DISTINCT date from a table with present people.

  • Message #544

    I would need to see your database schema and a concrete example of what you are trying to accomplish to fully understand what you are asking for. Preferably the example should be between 1-15 lines of code.

    • Message #549
      CREATE TABLE IF NOT EXISTS `prezenta` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `nume` varchar(100) NOT NULL,
        `anuntat` varchar(20) NOT NULL,
        `confirmari` varchar(50) DEFAULT NULL,
        `data` date NOT NULL,
        `rang` varchar(20) NOT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;
      

      so this is the table, so i have a lot of record with different data (date field), i want a list with data but to not receive duplicates records let's say ia have 10 record recorded with three diferent date, i want only three record with that different date values. do u understood now or you need any other information. in SQL calls DISTINCT rows, removing duplicates.