BTW: this is not life of death, I'm just playing with some code.
Fatal error: Using $this when not in object context in K:\business\catalogue.php on line 22
<?php
session_start();
include('../_site_config.php');
//Business tier class for reading product catalog information
class Catalog{
public $lists;
//Retrieves all pic_types
public static function getPicTypes(){
//build SQL query
$sql = "SELECT pic_type FROM pictures";
//Prepare the statement with PDO-specific functionality
$result=DatabaseHandler::Prepare($sql);
//Execute the query
return DatabaseHandler::GetAll($result);
}
public static function listPicTypes(){
//make the to display pic_types
$this->lists=Catalog::getPicTypes();
for($i=0;$i<count($lists);$i++){
echo "<li>".$lists[$i]['pic_type']."</li>";
}// end for loop
}// end listPicTypes function
}//end Catalog class
?>

New Topic/Question
Reply




MultiQuote





|