the function keeps returning 1. if i echo $i within the function then it counts up to six. the function should return 6, because there are 6 results from the mysql_query, so $i iterates upto 6. please any help solving this?
$i=0;
$thewidth = $database->width($theid, $i);
echo $thewidth;
function width($theid,$i)
{
$get = mysql_query("SELECT * FROM block WHERE sid='$theid'",$this->connect);
$i++;
while($row = mysql_fetch_assoc($get)) {
$number = $row['id'];
$this->width($number, $i);
return $i;
}
}