Jump to content

Zend 1.10 DB Connection Frustration!!!


GregL83

Recommended Posts

I posted something earlier...  I upgraded to Zend Framework 1.10.  I haven't done a DB connection with Zend before.  I am extremely frustrated with the setup.

 

I have my application.ini file as follows:

 

database.adapter = "PDO_MYSQL"
database.params.host = "localhost"
database.params.dbname = "test"
database.params.username = "root"
database.params.password = ""
database.params.isDefaultTableAdapter = true

 

And inside my index controller inside the index action i'm calling the following line to access the DB:

$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$db->fetchAll('SELECT * FROM test1');

 

Is my understanding that Zend will automatically setup the DB resource with my ini settings as is...  But I keep recieving the error:

 

Call to a member function fetchAll() on a non-object

 

I have passed one forum where this exact method is being used.  For the life of me I cannot seem to access the DB.  And zend tutorials/guides/docs with all the different versions just plain suck.

 

 

Here is where I found a resource: http://www.zfforums.com/zend-framework-components-13/databases-20/applicationi-ini-connect-db-2936.html

 

Link to comment
https://forums.phpfreaks.com/topic/207688-zend-110-db-connection-frustration/
Share on other sites

  • 2 weeks later...

i'm under the impression that zend should automatically register the default adapter declared in my config.ini/application.ini file...  i have been able to get an adapter obj other ways, but I want to know why I can't do it the way described in the zend tutorial.  this seems to be the standard way but i cant get it to work.... does it matter that the db wasn't created in the cmd line???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.