selecting no and data of results from the same function, how
Posted: Mon Jan 15, 2007 10:41 pm
i am using one function for fetching the data from mysql and another for fetching the no of data, but what i want to do is i want to return the no of data and data results from the one function only.
i am using two functions as:
-for fetching data
-for fetching no of data
above method is abviously tedious and non logical.
I want to do two action in one function, Please guide me.
Thanks in advance
i am using two functions as:
-for fetching data
Code: Select all
function selectAll()
{
global $ado;
$sql = "SELECT * FROM `category`";
return $ado->exec($sql);
}Code: Select all
function selectNo()
{
global $ado;
$sql = "SELECT * FROM `category`";
$result = $ado->exec($sql);
return $ado->row_count($result);
}I want to do two action in one function, Please guide me.
Thanks in advance