2014-08-28 42 views

回答

0

嘗試select

$select = new Select(); 
$select->from('table')//table name 
     ->columns(array('vch_no'))//place your column here 
     ->where()//condition array 
     ->order();//order column name 

例如:

$select = $db->select() 
      ->from(array('p' => 'products'), 
        array('product_id', 'product_name')); 
// Build this query: 
// SELECT p."product_id", p."product_name" 
// FROM "products" AS p 
+0

thanx您迴應 – 2014-09-16 11:02:12

0

試試這個

$objDb     = Zend_Registry :: get('db');//You need to setup the database configurations ready in the registry before using it 
$select     = $objDb->select(); 
$select     -> from('tablename',array('column1','column2')); 
$select     -> where() 
         -> order(); 
$rows     = $objDb->fetchAll($select);