PHsPeed applications communicate with a database to store and retrieve information. Depending on the situation, you might have a single development database containing all your projects, or create separate databases for your applications. Either way, PHsPeed requires that you define a data base connection independent  from your projects. The idea is that you can define a certain database connection and reuse that over (one or more) projects.


Not relevant for this project, but you can have multiple connections in your project, that can point to different databases or brands (combine oracle and mysql for example).


To create a new connection, go to database -> Connection/PDO


Two connections?


To work with PHsPeed, you require two connection definitions:


PHsPeed IDE


The ide needs to be able to access your database so that it can retrieve metadata, like your database structure, tables and fields


PHP


PHP needs to be able to access your database, and to be able to it requires a PDO specification. PDO is a database-independent layer that binds PHP to the database. Theoretically, PDO makes your applications database independent and that you can change database flavor by just pointing the PDO driver into another database. Unfortunately this is not always the case. For instance, using auto numbering on fields works differently for all database brands, and SQL is not that standard as well. PHsPeed, will generate database specific code when required, so if you want to migrate to another brand, than you must bind the database connection to another connector and regenerate your code. 



In this screenshot you can see that the PDO_MYSQL (the pdo driver) is already available. If you have another database, then you must create a new PDO connection string.


To add a new connection, enter a name as id and click on +, then enter the required data. Click on 'test connection' to confirm the connection, then the database drop-down will show you the new todo database. Use the correct select template, and click on ok. You have now created a valid database connection.