Ben Ripkens

back to blog index

Zend framework quick start with MySQL database

The Zend framework quick start guide describes how to use an SQLite database. I wanted to use a MySQL database instead. You should add the following lines to your application.ini if you want it to use a MySQL database.

[production]

; ...

resources.db.adapter = "PDO_MYSQL"

[staging : production]

; ...

[testing : production]

; ...

[development : production]

; ...

resources.db.params.host = "hostName" ; something like localhost or an IP
resources.db.params.username = "username"
resources.db.params.password = "password"
resources.db.params.dbname = "databaseName"

The create table script for the guestbook table.

--Uncomment the line below when executing this script in netbeans.
--use databaseName;

CREATE TABLE guestbook (
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    email VARCHAR(32) NOT NULL,
    comment TEXT NULL,
    created TIMESTAMP DEFAULT NOW()
);
That's me, Ben.
Hey, I am Ben Ripkens (bripkens) and this is my blog. I live in Düsseldorf (Germany) and I am employed by the codecentric AG as a Software Engineer. Web application frontends are my main area of expertise, but you may also find some other interesting articles on this blog.