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
Disabling SAP menu
How do I disable SAP menu for all the users and just restrict them to User Menu in SAP ECC 6.0?
PHP url branch??
Functionally, using PHP, I'm doing a test of login input submitted by a user via an html form in a f
duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no
help finding hacking loopholes
i was attacked by a redirect php injection
my pc is clean of viruses
so i figure that
Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box
Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter
Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the
Matchcode in ALV change header column
Hello everyone,
I am working in an SAP system that is currently in upgrade and conversion
Opening Multiple Files/Links in Order.
I want to open links in order/one-by-one and check each for a specific string.
Example:
I
Getting a variable to work in function params
I have this fuction which is inside a class:
Code: public static function generateEmbedCode($