I have a function in a class called database, the function as below
function getTaskData(){
$q = "SELECT * FROM ".TBL_CLIENT ;
$result = mysqli_query( $this->connection,$q);
if(!$result || (mysqli_num_rows($result) < 1)){
return NULL;
}
/* Return result array */
;
while ($dbarray = mysqli_fetch_array($result)) {
return $dbarray;
}
}
Please note that $dbarray is from while loop, however, i want to call the function to loop out specific data from the table in a while loop
please see below, i am calling the function from another page
$taskData= $database->getTaskData();
$taskStatus = $taskData['status'];
echo $taskStatus
I want $taskStatus to be in a loop.
$resultfrom your function and iterate it where you need.