Class function that is retrieving values from db
public function retrieveFun()
{
include 'inc/main.php';//connecting to db.
$result = mysqli_query($con,"SELECT * FROM db order by name DESC");
while($row = mysqli_fetch_array($result))
{
$var = array('name' =>$row['name'] ,
'owner'=>$row['owner'],
'date'=>$row['date'] );
// echo $var["name"]."<br/>";
// echo $var["owner"]."<br/>";
// echo $var["date"]."<br/><br/>";
return array($var["name"],$var["owner"],$var["date"]);
}
}
and code where I want to display all the rows retrieved in desired format
$obj = new classname();
$id= $obj->retrieveFun();
echo //here i want to display all the rows retrieved in table format.
Please help me out as soon as possible
// echo $var, and you will have an idea of what is happening.