Skip to main content

Posts

Showing posts from January, 2014

Install Zend Framework in Wamp

Zend Framework is an open source, object oriented web application framework build for enterprises and high level  web application development . Zend Framework(ZF) provided bunch of libraries which is helping developer in web development. ZF is little hard to install and understand for beginner(freshers) specially who are working first time in any framework specially zend framework 2 installation.There is many website who are providing step to install zend framework in windows machine but personally they haven't put installation step very clearly to keep in mind for freshers. Here is steps  install zend framework in wamp  (Windows) : 1. Download zend framework skeleton from  https://github.com/zendframework/ZendSkeletonApplication 2. Unzip ZendSkeletonApplication-master and rename it zf (change folder name as your convenience). 3. Copy zf and paste it in wamp's www root directory in my case its  c:\wamp\www 4. Now download composer window installer from  http://getcomposer

How to Use Two Database in Yii PHP Framework

Recently in one of Ireland based project client has requirement to use existing Microsoft SQL Server database and implement new feature and store data into MySQL database with Yii Framework. First we have  install and implement microsoft sql server driver in wamp server  to make in localhost environment. Now we have to connect both the Database in Yii Framework. Following is steps to implement in Yii Framework : 1. In protected/config folder open main.php and add below code in component for mysql and sql server connection 'db'=>array(  // default mysql connection 'connectionString' => 'mysql:host=localhost;port=3306;dbname=db_name', 'emulatePrepare' => true, 'username' => 'db_username', 'password' => 'db_password', 'charset' => 'utf8', 'tablePrefix' =>'tbl_',  // if have prefix in database tables ), 'msdb'=>array( // microsoft sql server connection

Install Microsoft SQL Server Driver with WAMP

Most of PHP developer very much familiar with MySQL Database but We talk about Microsoft SQL Server we find lack for knowledge on PHP with SQL Server even on the google and php.net official website. Even the hosting company provide Pre-installed PHP and MySQL on the Server. Here some explicit instructions for install Microsoft SQLServ Driver in WAMP 32bit with PHP 5.3 : 1. Open http://www.microsoft.com/en-us/download/details.aspx?id=20098 for Download Microsoft SQLServ PHP Driver 2. Download SQLSRV30.EXE (Windows Vista, Server 2008, Windows 7 or above) or SQLSRV20.EXE (Server 2003/Windows XP or below). 3. Run SQLSRV30.EXE and enter your PHP bin folder path to Install Driver DLL files. 4. Open php.ini file and enable php sqlserv extensions extension=php_pdo_sqlsrv_53_ts.dll extension=php_sqlsrv_53_ts.dll 5. Restart All services in Wamp and confirm pdo_sqlsrv extension enable in phpinfo 6. Put you database connection string detail and User below php code to check database connec

Custom export into excel in Yii Framework

Hello Friend, In one my project  developed in yii . I was struggling to export the cgridview data into excel. I searched many plugin and read the tutorial. But not get proper solution specially with relational data from one or many models (database tables). I try eexcelview, toexcel etc. yii plugin but it was really slow specially on large data fetch and also not getting proper excel format. After spending some time, i planed to write my own custom export in excel code in  yii framework . 1. In model search function define session global variable and store active search data (set pagination false so you will get all the record without paging) public function search() { $criteria=new CDbCriteria; $criteria->compare('vendor_debit_id',$this->vendor_debit_id); $criteria->compare('hotel_id',$this->hotel_id); $criteria->compare('supplier_name',$this->supplier_name,true); $criteria->compare('debit_amount',$this->debit_amount)