Metrics on a front end page

Home Forums Legacy Support Support queries How-to & Troubleshooting Metrics on a front end page

Tagged: ,

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #234570
    nitwayne
    Participant
    Hi, We would like to design a webpage that displays the number of student or people registrations, student registrations based on different dates/months, based on different colleges. Also, the number of students who have finished particular courses and other things. This is an immediate requirement for us to show it to people about all our stats so far. And we want this to get updated in real-time. Please help
    #234574
    nitwayne
    Participant
    This reply has been marked as private.
    #234648
    Anshuman Sahu
    Keymaster
    Well please tell about the colleges ? We have course system not college system. We can make sure of location taxonomy for that? and can bring the stats based on this . About live stats for this we would need to run an api call from server which will fetch the details from databsae in loop. this would need a strong server as the queries would be bit heavy .      
    #234651
    nitwayne
    Participant
    This reply has been marked as private.
    #234809
    Anshuman Sahu
    Keymaster
    Well writing the query to fetch the desired is the whole job actually. It cannot be done with single query it will require many queries and code which would take time . Provide time to write that code for you .
    #235673
    nitwayne
    Participant
    This reply has been marked as private.
    #235827
    logan
    Member
    no. of registrations SELECT COUNT(*) FROM wp_users where user_registered BETWEEN '2019-10-01 07:15:57' AND '2019-10-09 12:41:34' no. of registrations based on the location or college $location = "JAKARTA"; $db_query = “SELECT COUNT(user_id) FROM wp_bp_xprofile_data WHERE field_id = 33 AND value = "" .$location ."""; buddypress profile fields .     no. of students who have completed different courses: what do you mean different here, is it a group of courses?   no. of unique users who has taken courses SELECT COUNT(DISTINCT(u.user_id)) FROM wp_usermeta as u LEFT JOIN wp_posts as p ON p.ID = u.meta_key WHERE p.post_type = 'course' AND p.post_status= 'publish'    
    #235861
    nitwayne
    Participant
    This reply has been marked as private.
    #235917
    logan
    Member
    Dear friend, this is direct SQL codes to your database, if you are ignorant of these codes then you can hire a freelancer to achieve your desires. good luck
    #236465
    nitwayne
    Participant
    I'm aware of the SQL codes or queries. I wanted to know how I can display it on the front end of the page. Should I use PHP code snippets or code shortcodes on the frontend page to display or what do you suggest? Because I don't want to go to PHPMyAdmin every time to run the SQL queries.
    #236548
    logan
    Member
    Hello, the shortcode is the best idea. it will become the reusable snippet. you can use this anywhere in post/pages/course/ quiz etc.
    #236675
    nitwayne
    Participant
    This reply has been marked as private.
    #236783
    logan
    Member
    Hello, this is direct SQL queries. you need to make the database connection then use it in the php codes. or use WordPress codex about the database: https://developer.wordpress.org/reference/classes/wpdb/ if we will write the codes it will come under the customization request for a nominal cose of 79$. this is a complex query and it will take time and debugging.
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Metrics on a front end page’ is closed to new replies.