I think I'm getting closer, but still not there. First of all, the CURRDATE() command doesn't work for me. I suspect that it's because Network Solutions is running an older version of PHP (version 4.4.7)
I substituted the DATE("Y-m-d") command
To work through this, and understand it, I put it in a tutorial code that was working for me. That code is as follows:
<?php
// command to open the configuration for the calendar removed
// command to connect to the database removed
$query = "SELECT *, STR_TO_DATE(CONCAT_WS('-', year, month, day), '%Y-%c-%e') AS full_date FROM calendarix_events";
$result = mysql_query($query);
$row = mysql_fetch_array( $result );
$row = mysql_fetch_assoc($result);
echo "Title :{$row['title']} <br/>" .
"Year : {$row['year']} <br/>" .
"Month : {$row['month']} <br/>" .
"Day : {$row['day']} <br/>" .
"Date : {$row['full_date']} <br/>" .
"Today : " . DATE('Y-m-d') ." <br>";
" <br/>" ;
mysql_free_result($result);
// command to close the database removed
?>
and that gives me the results I was expecting (you can see it at http://www.grapevinesailingclub.com/_php/mytest_1.php)
However, if I add the command
WHERE full_date >= DATE('Y-m-d') ORDER BY full_date ASC LIMIT 1
to the end of line 3, so it all reads:
<?php
// command to open the configuration for the calendar removed
// command to connect to the database removed
$query = "SELECT *, STR_TO_DATE(CONCAT_WS('-', year, month, day), '%Y-%c-%e') AS full_date FROM calendarix_events WHERE full_date >= DATE('Y-m-d') ORDER BY full_date ASC LIMIT 1";
$result = mysql_query($query);
$row = mysql_fetch_array( $result );
$row = mysql_fetch_assoc($result);
echo "Title :{$row['title']} <br/>" .
"Year : {$row['year']} <br/>" .
"Month : {$row['month']} <br/>" .
"Day : {$row['day']} <br/>" .
"Date : {$row['full_date']} <br/>" .
"Today : " . DATE('Y-m-d') ." <br>";
" <br/>" ;
mysql_free_result($result);
// command to close the database removed
?>
It all breaks. You can see the result at http://www.grapevinesailingclub.com/_php/mytest_2.php
I suspect because I'm trying to reuse what I did before, that I'm misusing the mysql_fetch_assoc command.
Can you guide me more from here?
Thanks in advance.