31,003
edits
| Line 62: | Line 62: | ||
== Générer la classe PHP d'accès == | == Générer la classe PHP d'accès == | ||
Once you have created your tables into the database, move to the dev/skeletons directory and run the script | |||
<pre>php build_class_from_table.php nomtable</pre> | <pre>php build_class_from_table.php nomtable</pre> | ||
Note: If the command does not work, try to use php-cli php instead. | |||
This will generate a file '''out.nomtable.class.php''' that contains the class to manage table nomtable. | |||
In this class, you can find the CRUD methods (Create / Read / Update / Delete) already working to do an insert, a fetch (select), an update, a delete of a row in table. | |||
Remove just the "out" from the file name and put the file in a subdirectory of '''htdocs''' specific to your module (in htdocs/mymodule for example). | |||
A file '''out.nomtable_script.php''' has been generated and contains a sample code to use the class for each of the 4 CRUD methods. | |||
= Ajouter vos onglets sur les fiches entités (optionnel) = | = Ajouter vos onglets sur les fiches entités (optionnel) = | ||