Quick links: Content - sections - sub sections
EN

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:tutorial:database-config [2006/09/29 08:51] doublefaceen:tutorial:database-config [2007/09/17 22:42] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Configuring the database access ====== +This page has been moved to [[en:tutorials:main:database-config]]
- +
-Before going further with code, you have to configure Jelix to be able to access a database, and feed this databasea little bit. We will indeed store our news in a table +
- +
-Jelix can handle mysql, postgresql, sqlite and pdo. Through its driver system, it is possible to add other types of databases (if you don't want to use pdo). +
- +
- +
-===== Access configuration file ===== +
- +
-The access to a database is configured in the actu.org/var/config/dbprofils.ini.php file. In this file, you can specify one or several connexion profiles, then one ore several connexions. +
- +
-Each profile has a name and is  specified like this : +
- +
-<code ini> +
-[ProfileName] +
-driver="mysql"    ; name of the driver to use +
-database="foo"    ; name of the base to use +
-host= "localhost" ; name of the machine of the database server +
-user= "john"      ; connexion user +
-password="doo"    ; password +
-persistent= on    ; indicating if the connexion is persistent +
-</code> +
- +
-Except the dirver parameter, which is mandatory, the other parameters depend on the driver which is used. In general, you will have the database, host, user and password parameters. Change the content of this file according to your configuration. We will take as profile name "actu.org" for example, and we will define this profile as the default one by specifying it with the "default" parameter. +
- +
-<code ini> +
-default = actu.org +
- +
-[actu.org] +
-driver="mysql" +
-database="actu"   +
-host= "localhost" +
-user= "actu"    +
-password="actu" +
-persistent= on  +
-</code> +
- +
-Check in the actu.org/var/config/config.classic.ini.php file that the dbprofil parameter shows the dbprofils.ini.php clearly. +
- +
-<code ini> +
- dbProfils = dbprofils.ini.php +
-</code> +
- +
-It is indeed sometimes interesting to have several entrance points, then several  settings sharing the same connexion profiles file, or that each one has its own connexions file. +

en/tutorial/database-config.1159519914.txt.gz · Last modified: 2006/10/17 20:31 (external edit)

Recent changes RSS feed Creative Commons License