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
Do While statement
hi guys,
This may sound trivial but im new to php and as part of an assignmenti have to const
Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....
Warning: session_start() [fu
Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website
Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but
LOOPing Problem
Hello All!
The following code loops through the data and displays the data accordingly. My p
Something like an INI editor or a DelimitedText-Editor
Hi all,
Am very, very, very new to PHP and not sure if I should be posting this to a Javascri
Run function every 5 mins ??
I have a function PostMessage()
How can I run it every 5 mins ??
Writing Windows Device Drivers with C
Yes: one of the nice features of C is void*. You can put anything there and get anything out. Very
Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does
Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but