SimpleSiteClass, SimpleDatabase, SimpledbMysqli and SimpledbAbstract Methods

(version 1.0.0simple, 1.0.0database, 3.0.0mysql, 1.0.0ab)


SimpleSiteClass, SimpleDatabase and SimpledbAbstract

While there are a number of methods for each of the major classes there are really only a small handful you will use on a regular bases.

I usually have this kind of code at the top of my page:

$_site = require_once(getenv("SITELOADNAME"));
$S = new SimpleSiteClass($_site);
// Set the properties of $S
$S->title = "test page";
$S->banner = "<h1>$S->title</h1>";
$S->css = "h1 { color: red; }";
$S->b_inlineScript = "console.log('this is a test')";
// Get the top and bottom sections.
[$top, $footer] = $S->getPageTopBottom();
// Render the page.
echo <<<EOF
$top
<p>Some test stuff</p>
$footer
EOF;

Or like this if you only need to do mysql queries.

$_site = require_once(getenv("SITELOADNAME"));
$S = new SimpleDatabase($_site);
echo "Start<br>";
$S->query("select 'barton' as fname, 'phillips' as lname");
[$fname, $lname] = $S->fetchrow('num');
echo "My name is $fname $lname<br>";

There are many more methods in the SimpleSiteClass and SimpleDatabase classes. Also, the dbMysqli is well documented in the SimpledbMysqli.Class.php file.


SimpledbTables
SimpleSiteClass Methods
Additional Files
Examples
Index

Contact Me

Barton Phillips : bartonphillips@gmail.com
Copyright © 2024 Barton Phillips
Project maintained by Barton Phillips
Last modified January 6, 2024