i have made a class which has functions to handle database activities like add, edit, delete etc. so what i am having problem is in the select statement…
what i want to do is execute the select query and find the num_rows in the class along with fetching the array tht the select statement fetches… is it possible to fetch inside class and show it outside using object… lemme know if i am not clear to you… here is my code…
public function selecthtml($table,$rows,$condition,$order,$limit)
{
$select = "select $rows from $table where $condition";
if($order != "" || $order != NULL)
{
$select .= "order by $order";
}
if($limit != "" || $limit != NULL)
{
$select .= "limit $limit";
}
$done = mysql_query($select);
if($number = mysql_num_rows($done) >= 1)
{
$res = mysql_fetch_array($done);
return true;
}
else
{
return false;
}
}
Now i want to show the values fetched by $res how do i do it?