Xdebug Installation & Configuration – Part 1

Introduction This document contains steps to install Xdebug and Configure it with Netbeans. Steps to install Xdebug and Configure it with Netbeans To install Xdebug and Configure it with Netbeans, steps are given below – 1. Install Xdebug for PHP by running following command in Linux environment sudo apt-get install php5-xdebug 2. Setup Xdebug.ini for […]

Read More

How to print last executed query in CakePHP2?

Follow the following steps to print last executed query in CakePHP2: To print last executed query: Add below code in app_model.php file which is located at root/cake/libs/model. public function getLastQuery() { Configure::write('debug', '2'); $dbo = $this->getDatasource(); $logs = $dbo->getLog(); $lastLog = end($logs['log']); return $lastLog['query']; } Add below line in your model where you want print […]

Read More