📚 Looking for current Exponential documentation? This site contains legacy SDK & API reference docs (eZ Publish era). For up-to-date 2026 product documentation, visit doc.exponential.earth.

  ezdb / introduction  

<< eZ db™  Fetch data >> 

The eZ db™ library is an abstract interface to the supported databases. This enabled you to create database independent PHP applications.

Connect to the database

eZ db™ will automatically connect to the current database and use the database implementation needed. To figure out this you need to have the correct settings in the configuration file settings/site.ini. There you can set the server to connect to, the username and password to use and which database should be used. You can also set which socket to use, this setting is specific for MySQL. You can enable or disable SQLOutput this will help you track all the database calls and help you debug when developing applications.

[DatabaseSettings]
Server=localhost
User=nextgen
Password=nextgen
Database=nextgen
Socket=disabled
SQLOutput=enabled

When you have your library properly configured you can just use the database instance to run queries to the database.

  // include the library
  include_once( "lib/ezdb/classes/ezdb.php" );

  // fetch the database instance
  $db =& eZDB::instance();

Exponential Copyright © 1998 - 2026 7x