Hi guys,
Help me to solve my script, i’m new in yii.
I has two tables:
++++++++++++++++++
company (id, name, product, contact, telp, fax, state) as my main data table
++++++++++++++++++
and
++++++++++++++++++
countclick (id, id_company, id_user, created, ip)
+++++++++++++++++++
(1, 80, 5, ‘2014-04-30 06:00:08’, ‘::1’),
(2, 50, 2, ‘2014-04-30 06:01:08’, ‘::1’),
(3, 82, 4, ‘2014-04-30 06:03:04’, ‘::1’),
(4, 120, 1, ‘2014-04-30 06:04:24’, ‘::1’),
(5, 11, 1, ‘2014-04-30 06:07:07’, ‘::1’),
(6, 50, 5, ‘2014-04-30 06:07:22’, ‘::1’),
(7, 11, 4, ‘2014-04-30 12:11:41’, ‘::1’),
(8, 50, 3, ‘2014-04-30 12:11:56’, ‘::1’),
(9, 50, 1, ‘2014-04-30 12:12:24’, ‘::1’),
(10, 11, 2, ‘2014-04-30 12:12:48’, ‘::1’);
on company page, user will click data/company he want to choose then save each click count into countclick table.
then on my index page, i want to show 25 highest company are most clicked by collecting data from countclick.
please help me with the SQL statement, right now i’m using CDbCriteria to show and save count click and was run good.
I don’t have no idea how to show 25 highest clicked company.
thanks a lot