SiteClass (version 7+ Psr-4 and PDO), Database and dbPdo Methods
SiteClass methods:
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. The ones most used have some documentation with them.
public function getPageTopBottom():array
public function getPageTop():string
public function getPageHead():string
public function getPageBanner():string
public function getPageFooter():string
public function getDoctype():string
public function __toString():string
There are a number of 'protected' methods and properties that can be used in a child class.
Database and dbPdo methods:
public function sql()
This is the workhourse of the database.
It is used for 'select', 'update', 'insert' and basically anything you need to do
like 'drop', 'alter' etc.
public function fetchrow(=null, ="both")
Probably the second most used method.
If it follows the sql statment the is not needed.
The only time is needed is if there are other queries in a 'while' loop.
In that case you need to get the result of the query by calling the getResult()
method before running the 'while' loop.
The can be 'assoc', 'num' or default 'both'. 'assoc' returns only an associative array,
while 'num' return a numeric array.
I usually use a numeric array:
while([...] = bartonlp\SiteClass\SiteClass->fetchrow('num') { ... }
public function getLastInsertId()
After an 'insert' this method returns the new row's primary key id.
public function getResult()
Returns the result object from the last sql statement. Usually not needed.