zend1查询转换为普通的mysqli?

时间:2015-03-20 15:37:45

标签: zend-framework mysqli

我有这个zend framework 1查询,如下所示:

function getNumberOfNewPlayer() {
    global $db, $start_date, $end_date;
    $data = $db->select()
            ->from(array('c' => 'casino_israel.Network'),array('count(*) as total'))
            ->where('c.Date > ?', $start_date)
            ->where('c.Date < ?', $end_date)
            ->query()->fetch();         
    return $data['total'];  
}

在普通的mysqli中它看起来怎么样?谢谢!

1 个答案:

答案 0 :(得分:-1)

$data = $db->select()
            ->from(array('c' => 'casino_israel.Network'),array('count(*) as total'))
            ->where('c.Date > ?', $start_date)
            ->where('c.Date < ?', $end_date);

echo $data->__toString();