$php_mysql$ Posted January 26, 2011 Share Posted January 26, 2011 hi friends. to fetch results from the database i made a function and how i call the function on a page like $results = GetResults($someID); when i print_r the $results i get all the results, but now im confused on how do i print the rows individually? say i got Title row how will i only get the Title row from the $results VAR? Link to comment https://forums.phpfreaks.com/topic/225747-how-do-i-now-display-the-results/ Share on other sites More sharing options...
litebearer Posted January 26, 2011 Share Posted January 26, 2011 presuming $results is an array... $results = GetResults($someID); $c = count($results); $i=0; while($i<$c) { echo $results[$i] . "<br>": $i ++; } Link to comment https://forums.phpfreaks.com/topic/225747-how-do-i-now-display-the-results/#findComment-1165509 Share on other sites More sharing options...
$php_mysql$ Posted January 26, 2011 Author Share Posted January 26, 2011 thanks mate got it done by foreach. :-) Link to comment https://forums.phpfreaks.com/topic/225747-how-do-i-now-display-the-results/#findComment-1165570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.