palAlaa
palAlaa

Reputation: 9878

How do I configure the database on Zend framework?

I want to configure the adapter on Zend. I tried this:

zf configure db-adapter 'adapter=PDO_SQLITE\&dbname=APPLICATION_PATH "/../data/db/guestbook.db"' \production

This gives an error message saying that dbname is not recognized as an internal command.

What should I do to fix this?

Upvotes: 0

Views: 1019

Answers (2)

Dinesh Sahoo
Dinesh Sahoo

Reputation: 80

I found the same problem but was able to find the solution. The problem is with the quotes please try this which worked for me PDO_MYSQL for mysql and PDO_SQLITE for sqlite

zf configure db-adapter 'adapter=PDO_MYSQL&dbname=APPLICATION_PATH "/../data/db/guestbook.db"' production

Thanks

Upvotes: 0

Liyali
Liyali

Reputation: 5693

There must be something wrong with the syntax you are using. I assume you're using Windows.

Try this command:

zf configure db-adapter "adapter=PDO_SQLITE&dbname=APPLICATION_PATH '/../data/db/guestbook.db'" production

I guess there is no need to escape the "&" sign too. However, if you can't make it work this way, you can simply add in your application.ini file these two lines:

resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook.db" resources.db.adapter = "PDO_SQLITE"

This will basically have exactly the same effect.

Upvotes: 1

Related Questions