Mysql
 sql >> Database >  >> RDS >> Mysql

Incrementa una colonna in MySQL

Si C'è. Ecco un esempio di utilizzo di prodotti e incremento di un campo di quantità:

$table     = 'products'; 
$data      = array('prd_qnty' => new Zend_Db_Expr('prd_qnty + 1')); 
$where[] = $db->quoteInto('pr_id = ?', $this->pr_id); 
$db->update($table, $data, $where);