while loop - PHP: Whileloop return all rows -
i having trouble in returning rows while loop. when checking print_r($item) it's returning rows when user return in while loop returning first row. think because return loop @ first time.
so how can return rows.. here trying
while($item = db_assoc($query)){ return '<p>'.$item['title'].'</p>'; }
the while loop within class method , have return value can't use echo
thanks lot....
like say, you're returning after first row. try following:
$output = ''; while ($item = db_assoc($query)) { $output .= "<p>{$item['title']}</p>"; } return $output;
Comments
Post a Comment