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...
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
why is it over writing
Code: $filepaths[] = $_FILES['new_image'];
foreach ($filepaths as $filepath)
{
$imagename =
PHP error on MySQL insert
I'm sure it's the simplest of issues, but I can't recall why this isn't working.
Code: [Selec
my code does not work.
I have a code problem.
Quote"<a href=index.php?gogo=ureticidetay&'?l={$le
Vertical Alligning - Not working in 1 cell?
<?php
echo "<table id="valign" width="60%" style=
User information
Hi All,
By using t-code SUIM we get all the user details,if suppose we donot have permission t
generate seo frienly url from a text like wordpress
Convert: "åäö" to "aao", "space" to "-", "!?&q
Dynamically allocating the number of rows in a table based on a variable value
Hi,
I have situation here which i cannot resolve, I have a variable temp which stores the num
Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,
Im relativity new to PHP and MySQL and i have come up against a problem. i h
limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h
Transaction variant for VA02 not working
My requirement is to have transaction for user to only add the output and print a sales order.