Database set up

Before you can build database aware applications, you need to set up things correctly. For the PHsPeed IDE, it means that it needs to access the database to retrieve meta-data like tables and fields. The PHP.ini needs to be set up to include the required database routines so that PHP will connect. For PHP coding, it means that it needs a decent PDO set up to connect. If you are new to PHP coding, this might sound not very clear, but fortunately, you only need to do this once.

1. Setup PHP.Ini to use the required database(s)

This is the easiest step as you can do this from within the IDE itself. Just set the checkboxes for the databases you want to support and click apply. This will modify the php.ini and restart the internal webserver. To limit the required system resources, do only check the required databases. On larger development systems it might not be an issue, but why load php modules you don't need ?

2. Setup the required PDO strings for the databases you want to use.

For MySQL / MariaDB, there is already a pre set up. But for other databases you must create one yourself. Depending on your database, the parameters might differ (see screenshot at the appropriate databases). But in general, the following rules apply:

Setup a correct local database client that is needed to communicate with your database. That can be a 'simple' client like Oracle, but it might be needed to install an odbc/ado driver, i.e. for SQLSever and Progress Open Edge. The samples on this page are based upon the installation of the database on the same system (we use developer editions of Progres, Oracle, PostgreSQL, and SQL Server).

3. Setup the required database connection(s).

Below, you can select the required database to look at the setup parameters. In all cases, you need to specify some SQL dependencies, as SQL is not a 100% standard. In the case of PHsPeed, you must supply the SQL statement that is required to limit result sets. If you have situations where you use hyphens in your table and/or field names, you must supply a select template that fixes the hyphens for SQL. (If you have control of your datamodal, avoid using Hyphens, but use underscores).

SQL Server
Progress OpenEdge

  • dbsetup.txt
  • Last modified: 2020/11/03 14:47
  • by aducomadmin