Tuesday, April 24, 2012

Transaction using yii CDbTransaction

As for my reference and note,
CDbConnection::beginTransaction

$transaction=$connection->beginTransaction();
try
{

   $connection->createCommand($sql1)->execute();
   $connection->createCommand($sql2)->execute();
   //.... other SQL executions
   $transaction->commit();
}
catch(Exception $e)
{
   $transaction->rollBack();
}

Thursday, April 12, 2012

Netbean 7.1.1 problem

1). When create a project finding the Netbean will create a folder (nbproject)
2). make sure to remove when you remove a project from your Netbeans workspace (using the IDE), Netbeans allow you to remove the project without delete the sources. So, when it's done, you must delete the "nbproject" directory that was created inside your source project.

otherwise will get error when try to create new project (from existing source) in the same diretory, Netbean will show this error : 
"Sources directory is already Netbeans project (maybe only in memory)"

so make sure to delete folder "nbproject" in your application diretory.

Xampp 1.7.7, step to enable ldap module

Lately, i am into php and trying to use xampp 1.7.7.
When using ldap extension got error trying to start :-

1) edit file httpd.conf , enable the : LoadModule ldap_module modules/mod_ldap.so (OK)
2) when i enabled the extension in php.ini : error could not load module ldap.dll. When checked ldap.dll exists in the /ext.

So, try again restart xampp and got different error : unable to load  libsasl.dll
solution :-
3) copy libassl.dll to xampp\apache\bin\ (start again xampp and OK)

now i can call ldap_connect from php