DATEDIFF Question
Posted on
16th Feb 2014 07:03 pm by
admin
First time post, and of course it is a help question.
I am using a WP plug-in to display previous and next games in a season. (Leaguemanager is the plug-in name - Link http://wordpress.org/extend/plugins/leaguemanager/ ). The challenge I am having is that the previous game only displays the first game of the season, not the actual previous game...
Did you know?Explore Trending and Topic pages for more stories like this.
The following code is pulled from the shortcode.php file in the lib folder of the plugin.
Here is the code for the next game which works...
$next_matches = $leaguemanager->getMatches("( `home_team` = {$team->id} OR
`away_team` = {$team->id} ) AND DATEDIFF(NOW(), `date`) <= 0");
$next_match = $next_matches[0];
Here is the code for the previous game that pulls the first game of the
season, not the actual previous game.
$prev_matches = $leaguemanager->getMatches("( `home_team` = {$team->id} OR
`away_team` = {$team->id} ) AND DATEDIFF(NOW(), `date`) > 0");
$prev_match = $prev_matches[0];
It's probably something really simple, but I have been ahcking away at this for about 8 hours and I cannot get it to work. On a side note if you swap the "0" for a "1" in this line $prev_match = $prev_matches[0]; it will show the second game of the season.
Thanks
No comments posted yet
Your Answer:
Login to answer
185
43
Other forums
utf8_general_ci error ??
I have all kinds of data to be inserted in database table
//I am getting this error
Yo
IMAGE - SERVER SIDE scripting help...
How to receive pixel data of an image and buid a bitmap file on the server using the HTTP POST metho
Cloud Computing?
Hello,
I was wondering if anyone could help explain this term to me. I'm starting to hear it
Accessing Infotype data in dialog program
Hi All
In Dialog programs attributes I didn't see any logical database field. How can I access
Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be
mysql select query problem
how can i select multiple fields from multiple table in one query like
i have table name t1 a
quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...
I often see an exa
PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.
How would I exac
Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us
Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,
I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.
CALL FUNCT