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
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???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.