Trace:
Differences ¶
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:tutorials:main:database-config [2007/09/17 22:42] – external edit 127.0.0.1 | en:tutorials:main:database-config [2008/11/19 21:42] (current) – laurent | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Configuring the database access ====== | ||
Before going further with code, you have to configure Jelix to be able to access a database, and feed this database a bit. We will indeed store our news in a table. | Before going further with code, you have to configure Jelix to be able to access a database, and feed this database a bit. We will indeed store our news in a table. | ||
Line 7: | Line 6: | ||
===== Access configuration file ===== | ===== Access configuration file ===== | ||
- | The access to a database is configured in the news.org/ | + | The access to a database is configured in the news.org/ |
- | Each profile has a name and is | + | Each profile has a name and are specified like this : |
<code ini> | <code ini> | ||
[ProfileName] | [ProfileName] | ||
driver=" | driver=" | ||
- | database=" | + | database=" |
- | host= " | + | host= " |
- | user= " | + | user= " |
password=" | password=" | ||
- | persistent= on ; indicating if the connexion | + | persistent= on ; indicating if the connection |
force_encoding = off; | force_encoding = off; | ||
</ | </ | ||
- | Except the driver parameter which is mandatory, the other parameters | + | Except the driver parameter which is mandatory, the other parameters |
Now change the content of this file according to your configuration. We will take as profile name " | Now change the content of this file according to your configuration. We will take as profile name " | ||
Line 39: | Line 38: | ||
- | Note: It is indeed sometimes interesting to have several entry points, then several settings sharing the same connexion | + | Note: It is indeed sometimes interesting to have several entry points, then several settings sharing the same connection |
<code ini> | <code ini> | ||
Line 71: | Line 70: | ||
We are now ready to use this data in our application. | We are now ready to use this data in our application. | ||
- | ---- | ||
- | * Next : [[en: | ||
- | * Previous : [[en: | ||
- | * [[en: |