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
PHP and Javascript
Hi Guys,
Im trying to load the contents of an html file into a text area for editing, this is
mr8m - reverse document
Friends,
I'm trying to reverse a document held by MIRO, but it reports the message balan
values in array being escaped
I would like to submit some values - back to the same form for checking before processing...
how to export excel file in same server
My first post - php newbie, so appreciate your support.
I'm currently using headers to save w
Variable passed to each() is not an array or object
Hi,
This is a email a friend type of form, and it isn't working anymore.
<?
Socket problem
Hello,
Earlier I posted about my problem with my socket script. It took up to 100% CPU usage.
Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop
php problem?
I don't think I'm stupid, but maybe I am.
I am working on a sit for a friend I am try to put
Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using
About imagecopyresampled()
Hello,
I am looking to use this function to resize parts of an image to a fixed thumbnail siz