Author Topic: Statistic  (Read 5010 times)

0 Members and 1 Guest are viewing this topic.

Offline Yatahonga

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • http://www.yatahonga.com/
Statistic
« on: May 05, 2003, 01:30:07 PM »
Hi,

I would like to know how many new
- registered user
- images

I have BY Day.

I didn't find the good SQL request. Does anyone have do that ?

Thanks

Cyrille

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Statistic
« Reply #1 on: May 05, 2003, 02:07:45 PM »
if u know little bit PHP, then take a look at index.php, where the new images shows. It uses time limit. u can easily use same alghorithm to count how many images where added today, with little modifications same could be done for users.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Yatahonga

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • http://www.yatahonga.com/
Statistic
« Reply #2 on: May 05, 2003, 02:18:17 PM »
Yes of course in PHP, but
I am looking for something like
select * from user group by inscription_date

With a format(inscription_date, XXXX)

Else I can add a colum (date as String) which contain the date like 05/005/2003 and do the select on this news colum

Cyrille

Offline Yatahonga

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • http://www.yatahonga.com/
Statistic
« Reply #3 on: May 05, 2003, 02:19:04 PM »
sorry,

select count(id) from user group by MyNewDateColum

Cyrille

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Statistic
« Reply #4 on: May 05, 2003, 02:37:25 PM »
well, try something like this:
Code: [Select]
$time = time() - 60 * 60 * 24 * 1;
$sql = "SELECT COUNT(user_id) AS new
FROM ".USERS_TABLE."
WHERE user_joindate >= ".$time;
$users = $site_db->query_firstrow($sql);
$sql = "SELECT COUNT(image_id) AS new
FROM ".IMAGES_TABLE." i
WHERE image_date >= ".$time;
$images = $site_db->query_firstrow($sql);

then u'll have new images in last 24 hours in $images['new'] and users in $users['new']

*havent test it though
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)