
Untitled
By: a guest on
Aug 11th, 2012 | syntax:
None | size: 0.95 KB | hits: 7 | expires: Never
Concatenate div tag to db result
$divtag1 = '<div style="color:#1569C7; font-weight:bold">';
$select = $this->select()
->from(array('ta' => 'tableA'),
array('ta.id',
'name' => new Zend_Db_Expr("concat($divtag1 . ta.name . '</div>')"),
'date' => new Zend_Db_Expr("date(ta.date)")
));
$result = $this->getAdapter()->fetchAll($select);
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
. ta.name . '
') AS `name`, da'
'name' => new Zend_Db_Expr("concat('$divtag1', ta.name, '</div>')"),
$divtag1 = '<div style="color:#1569C7; font-weight:bold">';
$select = $this->select()
->from(array('ta' => 'tableA'),
array('ta.id',
'name' => new Zend_Db_Expr("concat($divtag1 , ta.name , '</div>')"),
'date' => new Zend_Db_Expr("date(ta.date)")
));
$result = $this->getAdapter()->fetchAll($select);