31,003
edits
| Line 134: | Line 134: | ||
Then enter your code to display the page. | Then enter your code to display the page. | ||
== | == Database access == | ||
{{ToTranslate}} | {{ToTranslate}} | ||
If you need to edit some data in database inside you own table, use the PHP class generated before. | |||
If you to make access to tables with no dedicated PHP class available, this is always possible (for example if you want to get a list of records with a particular join or filter). In this case, this is a code samples to follow: | |||
To make an insert, update or delete: | |||
<pre> | <pre> | ||
$db->begin(); // | $db->begin(); // Start transaction | ||
$db->query(" | $db->query("My SQL request insert, update or delete"); | ||
$db->commit(); // | $db->commit(); // Validate transaction | ||
or $db->rollback() // Cancel transaction | |||
</pre> | </pre> | ||
To read: | |||
<pre> | <pre> | ||
$resql=$db->query(" | $resql=$db->query("My select request"); | ||
if ($resql) | if ($resql) | ||
{ | { | ||