0
在我的應用程序中,我想打印一份列表,列出最近5分鐘在線的成員。帶間隔的ZF2 mysql查詢
我試圖通過下面的代碼與MySQL間隔創建此;
$interval = 5;
$select->where(array('member_last_online > ?' => 'SUBDATE(NOW(), INTERVAL '.$interval.' MINUTE)'));
哪些產生此通知;
Notice: Attempting to quote a value without specific driver level support can introduce security vulnerabilities in a production environment. in ..zf_path..
'getSqlSTring()'的輸出是;
SELECT "members".* FROM "members" WHERE member_last_online > 'SUBDATE(NOW(), INTERVAL 5 MINUTE)'
如果我下面直接放在桌子上執行查詢返回的數據爲接受:
SELECT members.* FROM members WHERE member_last_online > SUBDATE(NOW(), INTERVAL 5 MINUTE)
什麼是我錯在這裏做什麼?
我認爲你需要做一些事情:'$ adapter-> platform-> quoteIdentifier($ interv al)'看看這裏:http://stackoverflow.com/questions/13287731/quote-value-into-zend-framework-2 – Uffo