Hi,
I really don’t understand why this does not work…
$prod_model = new Product();
$products = $prod_model->selectByID(1);
$items = mysql_fetch_object($products);
echo $items->name; //I get error here
This line:
$prod_model = new Product();
Just refers to this class:
class Product{
public function selectByID($ID){
$query = "SELECT * FROM tbl_item WHERE deleted = 0 AND ID = ".$ID;
return mysql_query($query) or die(mysql_error());
}
}
The specific record exists in the database, i have even tried using :
$items = mysql_fetch_array($products);
Only difference here is that it shows nothing at all…
Can anyone please help me…
Thanks again