Registering Zend Database Adapter in Registry

If you’re using Zend Framework 1.8+, and created your project with the command line tool, then it’s as simple as registering your database settings in your application.ini config file. resources.db.adapter = “PDO_MYSQL” resources.db.params.host = “your.database.host” resources.db.params.dbname = “database_name” resources.db.params.username = “username” resources.db.params.password = “password” resources.db.isDefaultTableAdapter = true If your database settings are preceded by resources.db … Read more

How to print exact sql query in zend framework ?

Select objects have a __toString() method in Zend Framework. From the Zend Framework manual: $select = $db->select() ->from(‘products’); $sql = $select->__toString(); echo “$sql\n”; // The output is the string: // SELECT * FROM “products” An alternative solution would be to use the Zend_Db_Profiler. i.e. $db->getProfiler()->setEnabled(true); // your code $this->update($up_value,’customer_id =’.$userid.’ and address_id <> ‘.$data[‘address_Id’]); Zend_Debug::dump($db->getProfiler()->getLastQueryProfile()->getQuery()); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)