[Agavi-Users] No dsn specified -error

44 views
Skip to first unread message

surej ns

unread,
Mar 27, 2007, 7:54:48 AM3/27/07
to Agavi Users
 

 Hi all,

 

When I was tiring to select using

 

$c = new Criteria();

            $c->add(UserPeer::USERNAME, "Leo" );

            $c->add(UserPeer::PASSWORD, "Marx" );

            $results = UserPeer::doSelect( $c);  

I got this error.

 

 No dsn specified in your connection parameters for datasource [company]

 

  I am attaching my config file with this.

 

thax

surej

login-conf.php

Veikko Mäkinen

unread,
Mar 27, 2007, 8:04:01 AM3/27/07
to Agavi Users Mailing List
surej ns wrote:
>
>
> * No dsn specified in your connection parameters for datasource [company*]
>

As Propel 1.3 uses PDO you need to give the connection parameters as a
"DSN string".

see
http://propel.phpdb.org/trac/wiki/Users/Documentation/1.3/QuickStart#a4.SettingRuntimeConfiguration

or http://fi2.php.net/manual/en/ref.pdo.php#pdo.drivers


-veikko


_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

surej ns

unread,
Mar 27, 2007, 8:18:21 AM3/27/07
to Agavi Users Mailing List
thax veikko
 
if i am using mysql
how can i rewrite  the below code
 
 <adapter>sqlite</adapter>
    <connection>
     <dsn>sqlite2:/path/to/bookstore.db</dsn>
</connection>

 

surej


 

surej ns

unread,
Mar 27, 2007, 8:31:30 AM3/27/07
to Agavi Users Mailing List

sorry veikko

 

I have send u reply for the wrong stuff…here is my run runtime-conf.xml

 

<propel>

            <datasources default= "company">           

                  <datasource id ="company">

                        <!-- the Propel adapter (usually same as phptype of connection DSN) -->

                        <adapter>mysql </adapter>                       

                        <!-- Connection DSN.  See PEAR DSN format for other supported parameters. -->

                        <connection>

                              <phptype>mysql </phptype>

                              <hostspec>localhost </hostspec>

                              <database>company </database>

                              <username>test </username>

                              <password>testpass </password>

                        </connection>                       

                  </datasource>                

            </datasources>   

      </propel>

 

Just go through

 

Thax

surej

Veikko Mäkinen

unread,
Mar 27, 2007, 9:04:02 AM3/27/07
to Agavi Users Mailing List
surej ns wrote:
> sorry veikko
>
>
>
> I have send u reply for the wrong stuff…here is my run *runtime-conf.xml*
>

myproject-conf.php is just runtime-conf.xml converted to an array so it
doesn't really matter which one you send.

But the answer you are looking for was in those two links I sent.

Use the runtime-conf.xml format showed here:
http://propel.phpdb.org/trac/wiki/Users/Documentation/1.3/QuickStart#a4.SettingRuntimeConfiguration

and the DSN string format for Mysql showed here:
http://www.php.net/manual/en/ref.pdo.php#pdo.drivers
or here: http://www.php.net/manual/en/ref.pdo-mysql.connection.php

surej ns

unread,
Mar 28, 2007, 1:02:13 AM3/28/07
to Agavi Users Mailing List
hi Veikko,
I am using propel 1.3. to connect to database
 the error message is like this

 $dsn = $conparams['dsn'];   

  if ($dsn === null) {
        throw new PropelException('No dsn specified in your connection parameters for datasource ['.$name.']');

   }  

 $user = isset($conparams['user']) ? $conparams['user'] : null

i am attaching my runtime-conf.xml file with this
 
thax
surej
 
runtime-conf.xml

surej ns

unread,
Mar 28, 2007, 3:27:03 AM3/28/07
to Agavi Users Mailing List
Hi Veikko,
 
 

Thanks for your support

 

 The error was because of the wrong parameter in runtime-conf.xml.. For Propel was looking for user . But in config file it was username.

Sorry to trouble u

 

Looking for your support in future

 

Thanks once again

 

surej

surej ns

unread,
Mar 29, 2007, 2:24:33 AM3/29/07
to Agavi Users Mailing List

Hi Viekko,
How can i retrive every record form the db..like (select * from ) with out any condition.
Which function can i use for that.
 
Is this code fetch complete records..

$results

= UserPeer::doSelect(new Criteria());

and resulted in a error

Fatal error: Unsupported operand types in D:\xampp\htdocs\login\app\modules\Default\models\GetAuthUserModel.class.php on line 19

How can i fetch complete record

thax

surej

Reply all
Reply to author
Forward
0 new messages