Connection Parameters:
The PHP Generator connects to a MySQL database via an ADO.NET
connection. In order to connect to a MySQL database three
parameters need to be supplied. The following three parameters
can be provided in the "Connection Parameters" section
of the PHP Class Generator. NOTE: some user in the MySQL
database might not have a password. It is not essential
to provide a password if not applicable.
- Server - Name or IP of the MySQL Server
- User Name - DB User Name
- Password - DB Password
The parameters provided here will be used in the generated
DatabaseManager.php class. This class will be needed for
the generated classes to operate.
Class Information:
The PHP Generator creates Entity classes based on a MySQL
database schema. For example, if you have a table named Customers
with the following schema:
Customers |
|
CustomerID |
INT |
CustomerName |
Varchar(50) |
The PHP Generator will create a class the contains a loadById,
save and delete method. These methods will load, save/update
and delete a record from the database based on the primary
key, respectively. Setters and Getters will also be created,
but only the checked fields in the field list box will be
included.
The primary key field is the essential identification field
for the entity. It is used in the retrieval of the record
from the database. As mentioned above, it will be used in
the saving/updating and the deleting of the record.
The class name defaults to the name of the database table.
The user can change this to whatever name they would like,
but it is traditionally left to be the name of the table.
The final step to using the PHP Class Generator is the class
path. The class path is the location were the entity project
will be saved. NOTE: ADODB will be installed one directory
above the class path.
Databases:
The databases can be seen in the Available databases section
of the program. After successful completion of the connection
parameters the user will be shown the available list of
databases. Once the user chooses from this list of databases
he or she can continue to the class information section.
NOTE: if you do not see any databases after
the connection parameters are filled out, please check your
MySQL connection. You should get an error message if the
connection failed.
|