I am trying to use a MySQL builtin function to add x months to a date.
i.e. If you had to do something every x number of months. Read in from database the last time you did it. Add the x months and see if that date has passed.
using $sql = "SELECT INTERVAL 3 MONTH + "2001-12-22"
This works in MySQL itself.
using PHP
mysql_num_rows returns 1
$item = mysql_fetch_fields
$item->name returns my query string but I can't get the result.
I've tried everything mysql_result, mysql_fetch_array (both as a numerical and associative array), mysql_fetch_row. Nothing pulls out the answer. Anyone have any idea?
Thanks.
Marc
i.e. If you had to do something every x number of months. Read in from database the last time you did it. Add the x months and see if that date has passed.
using $sql = "SELECT INTERVAL 3 MONTH + "2001-12-22"
This works in MySQL itself.
using PHP
mysql_num_rows returns 1
$item = mysql_fetch_fields
$item->name returns my query string but I can't get the result.
I've tried everything mysql_result, mysql_fetch_array (both as a numerical and associative array), mysql_fetch_row. Nothing pulls out the answer. Anyone have any idea?
Thanks.
Marc