我在哪裏出錯了這個函數?我要求它提取提醒日期爲今年(單獨運行)的用戶,並且該類型等於電子郵件或電話(此部分不工作)。謝謝!將條件添加到elseif語句
elseif
($_GET['reminder'] == 'thisyear'
&&(isset($_GET['type'])
&& in_array($_GET['type'], array('Email', 'Call'))))
{
$thisyear = date('Y-m-d');
$todotype = $_GET['type'];
$query = "SELECT * FROM contacttodo,contacts WHERE contacttodo.contacts_id = contacts.ID AND YEAR(reminder) = YEAR(CURDATE()) AND contacttodo.type = '".$todotype."' ORDER BY contacttodo.reminder ASC";
}
UPDATE:這不返回任何記錄,並有幾個既「呼叫」和「電子郵件」
elseif
($_GET['reminder'] == 'thisyear'
&& (isset($_GET['type'])
&& in_array($_GET['type'], array('Email', 'Call'))))
{
$thisyear = date('Y-m-d');
$todotype = $_GET['type'];
$query = "SELECT * FROM contacttodo,contacts WHERE contacttodo.contacts_id = contacts.ID AND YEAR(reminder) = YEAR(CURDATE()) AND contacttodo.type = '".$todotype."' ORDER BY contacttodo.reminder ASC";
}
所以....沒有幫助的答案或建議? – joshua76