Home  >> Developers Forum  >> Query for recent suspensions

roberthans

Add new friend

Join Date:2017/2/20

Location:

Posts:4

Posted at 2017-02-25 16:33:48
[ Query for recent suspensions ]

Hello Friends,

I'm trying to write a query to find students who have been suspended from their courses within the last hour.

I'm using something similar to 

SELECT ue.userid
FROM prefix_user_enrolments ue
WHERE ue.status="1"
AND UNIX_TIMESTAMP() - ue.timemodified < 3600

To test it, I enter a course, go to Course Administration->Users->Enrolled Users and change a student's enrollment status from Active to Suspended in the "Enrollment Methods" column. Then I immediately run the report. I expect the suspended student to be returned by the query, however no records are returned.

Puzzled, I looked at the user_enrolments table and discovered that the "timemodified" field was not updated although I would have expected it to update to the time at which I suspended the student.

Shouldn't the field update? Or do I misunderstand the purpose of the "timemodified" field? If I misunderstand it, how should I modify query to get the records I want?





About Me:
I'm new in this forum, I am a consultant and have worked with multiple firms
You can check http://blog.advids.co/20-video-examples-from-it-security-management-software-solutions/ one of my work.

poonam

Add new friend

Join Date:2020/2/14

Location: India

Posts:0

NOTE:
1.The reply should be more than 20 characters.
2.Image Size: less than 1MB, max pixel: 300 * 300.