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.
dbPdo Database 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($result=null, $type="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([...] = $S->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.
SiteClass Methods
Additional Files
Main SiteClass