60 likes | 152 Views
ICS Software Development. -Instantiating an Object by example $oehdr = new_(“oehdr”); $oehdr->oebr = “F”; $oehdr->select(); //finds 1 st record $oehdr->select(array(“all” => true)); //all. -continued… If you find 1 record then the current object’s properties are set to that record
E N D
ICS Software Development
-Instantiating an Object by example $oehdr = new_(“oehdr”); $oehdr->oebr = “F”; $oehdr->select(); //finds 1st record $oehdr->select(array(“all” => true)); //all
-continued… If you find 1 record then the current object’s properties are set to that record If you find more than 1 record then an array of records is returned, and the property $oehdr->find_all contains a copy of that array
Sessions and “state” in PHP • PHP by default is a stateless language • Because the underlying technology is stateless • Statelessness means one request does not affect consecutive requests • (ie. Every request is treated as a brand new request) • $_SESSION is a global array meant to solve this problem • Sessions allow the server to keep track of visitors
Multi-Dimensional Arrays • $_SESSION[‘lda’] = array() • $_SESSION[‘lda’][‘udbr’] = ‘F’ • $_SESSION[‘lda’][‘udusnm’] = ‘CHARLES’ • $_SESSION[‘mvc’] = array() • $_SESSION[‘mvc’][‘app’] = ‘development’ • $_SESSION[‘mvc’][‘decorators’] = ‘ICS’ • $_SESSION[‘tmp’] = array() • $_SESSION[‘tmp’][‘oehdr’] = $oehdr