troubleshooting Question

MYSQL PHPFox Query

Avatar of TLN_CANADA
TLN_CANADAFlag for Afghanistan asked on
PHPMySQL Server
25 Comments1 Solution4203 ViewsLast Modified:
Hi everyone,

I'm trying to query the MYSQL database using the MYSQL PHPFox format. I would like to display the new records from this table in the past 24 hours.

Here is an example of a MYSQL query that is working that checks how many songs have been added in the past 24 hours:

$this->database()
->select('COUNT(*)')
->from(Phpfox::getT('music_song'))
->where('view_id = 0 AND time_stamp > '. (PHPFOX_TIME - 86400)) // less than 24 hours ago
->execute('getSlaveField'); 

We are trying to pull my the exercise_table how many view records have been created in the last 24 hours. The table is called exercise_table , the auto-increment field is called exercise_id and the timestamp field is called exercise_timestamp

Here is what I've been trying but it's not working correctly:

$this->database()
->select('COUNT(*)')
->from(Phpfox::getT('exercise_table'))
->where('exercise_timestamp > '. (PHPFOX_TIME - 86400)) // less than 24 hours ago
->execute('getSlaveField');

Thanks for your help,

D
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 25 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 25 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros