I am converting a php app to zend framework and utilizing Zend_Db_Table to make my queries. My problem is that after converting to zend format, my expected result for a text format field returns an empty string instead of the stored data.
A records with a text field length of 11000 always returns empty, however another record with 2500 length always returns correctly.
Is there something I need to configure? Is there a limit on the data that is returned using zend db table?
PHP MySQL using mysqli, returns true, var has value
$db = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$stmt= "select * from m_message where m.m_id='".$m_id."'";
$result = $db->query($q_message);
$result['m_content'] equals "I got a copy of the ..." (11000 characters / length)
Zend using pdo_mysql, returns true, var does not have value
$this->_db = Zend_Db_Table::getDefaultAdapter();
$stmt = $this->_db->query('SELECT m_content FROM m_message WHERE m_id = ? ', $messageId);
$result = $stmt->fetchAll();
$result['m_content'] equals (string)
$this->_db = Zend_Db_Table::getDefaultAdapter();
$stmt = $this->_db->select()->from('m_message', 'm_content')->where('m_id = ?',$messageId );
$result = $this->_db->fetchAll($stmt);
$result['m_content'] equals (string)
Update
Turns out it was appearing null while watching the variable while debugging in Netbeans. The var_dump of the variable actually showed the data, as expected. The problem was when I used the JSON helper to return the array as json. When looking at json_last_error(), it returned 5, JSON_ERROR_UTF8.
My DB Character Set is UTF-8, however to fix the problem I had to perform utf8_encode($result['m_content']) before passing it to the json helper :/