Both the IDE and the PHP applications need to be able to access the same database. On this page, we describe the steps you need to follow to specify database access so that you can use them in your applications.
Note! We get questions if the generated system is database independent. The boring answer is 'it depends'. As Databases are not standard, and you can supply your own SQL statements it is obvious that if you use a certain Database construct that is not supported by some other database, that you cannot 'just change the connection to another type of database' and expect it to work.
So if you need to create a real database-independent project that needs to run on different databases, say Oracle and MySQL, then you MUST be aware of the differences. So the complex answer is: PHsPeed can work with most databases, but you have to generate your project for each database separately to be safe. For most users, this will not be an issue. If you need one application that needs to be connected dynamically, depending on the customer (common in Saas environments) then this is not a problem, you can specify the credentials in the code.
In PHsPeed you define all your database connections in a single form. That way you can keep the connections together and you don't have to specify them over-and-over again.
1. Install your database client.
Depending on the database you use, you must install the appropriate client on your system. For MySQL, MariaDB, and SQLite you don't have to do anything when you are using the internal system. However, if you want to use a remote database, or a database of a different flavor (Progress, Oracle, etc.), you must set it up correctly before you can use PHsPeed. In general, you can use any database you like when there is a suitable odbc driver available. For some databases, the PDO database layer uses the native drivers.
2. Define your PHP connection string
The PHP Connection string is required as it takes care of PHP binding to the database. Some databases can have a different setup where not all of the connection parameters are set up in the PDO string but in a separate configuration file. Sometimes, it is up to the user how the database is setup. PHsPeed provides some basic connection strings you can use, but if needed, you can change them into a form that works for you. Btw. The strings are available in a pull down field, so you don't have to type them over.
3. Setup database connection
As the final step, you must specify a connection that will be used in your project. This connection will allow PHsPeed to access your database meta-data, the content, and some parameters to be able to generate the correct SQL.
To add a new connection, enter a unique name and click the add button. Then select the connection and supply: