How To : Set Port In Cdbconnection

Hi all…

i try using cdbconnection to connect sphinx server.

my sphinx server in localhost, my sphinx port in 9306.

when i config this , i got error messages [color="#FF0000"]" CDbConnection failed to open the DB connection."[/color]

this is my config cdbconnection.




$dsn='localhost';

$port='9306';

$connection=new CDbConnection($dsn,$port);

$connection->active=true;



question :

how to configure cdbconnection using port?

i have read http://www.yiiframework.com/doc/api/1.1/CDbConnection

nothing found about setup with port connection,.

Thanks.

Regards. :rolleyes: :rolleyes: :rolleyes: :rolleyes:

SOLVED :


I use this :


$dsn = 'mysql:dbname=catalog;host=127.0.0.1;port=9306;';

$port='9306';

$connection=new CDbConnection($dsn);



i set port in $dsn variable…

Thanks.