$valid
是一个数组,$createdon
并且$days
从数组中获取日期值。我的选择查询不适用于这些PHP
变量的日期值,请解决它。
function checkexpiretime($valid)
{
$db = &JFactory::getDBO();
foreach($valid as $validity)
{
echo $createdon=$validity->CreatedOn;
echo $days=$validity->days;
}
echo $query="SELECT * FROM jos_generatekey WHERE CreatedOn BETWEEN DATE_ADD('".$createdon."',".INTERVAL $days DAY.")". "AND CURDATE()";
$db->setQuery($query);
$checkexpire = $db->loadObjectList();
print_r($checkexpire);
return $checkexpire;
}