如何将参数传递给mysql,它将返回比今天更大的记录。
Find('all', array('conditions' => array(
'userstatus = ? and userdate >= ?', '-1', 'curdate()')));
问题是日期格式化不起作用。我尝试使用now()
代替curdate()
。日期以标准格式存储在MySQL中:YYYY-MM-DD HH ......等。
答案 0 :(得分:0)
First Name: {'Johnny': 2, 'Michael': 1, 'Andrea': 1}
Last Name: {'Got': 2, 'Jackson': 2}
Age: {'22': 2, '50': 1, '12': 1}
是您正在寻找的功能。请参阅:https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_from-unixtime
$document = new DOMDocument();
$document->loadXml($xml);
$xpath = new DOMXpath($document);
$keys = ['abc', 'def', 'ghi'];
$result = [];
foreach ($keys as $key) {
$result[] = $xpath->evaluate('string(/ROOT/SECTION[PART1="'.$key.'"]/PART2)');
}
var_dump($result);