decibel
07-19-2009, 05:35 PM
Hello, long time php developer here. I'm used to using the following code to retrieve db records and return an array with the results:
$query = "SELECT * FROM users LIMIT 10";
$result = mysql_query($query);
$rows = array();
while($row = mysql_fetch_array($result)){
array_push($rows, $row);
}
return $rows;
How can i stuff the results into an array from a Java bean to send an array back to JSP for i can iterate through it in JSP? I'm already connected to the db, i can execute queries, and my bean is accessable from my jsp page... i just need to know how to set up the array and return it.
Thanks again.
$query = "SELECT * FROM users LIMIT 10";
$result = mysql_query($query);
$rows = array();
while($row = mysql_fetch_array($result)){
array_push($rows, $row);
}
return $rows;
How can i stuff the results into an array from a Java bean to send an array back to JSP for i can iterate through it in JSP? I'm already connected to the db, i can execute queries, and my bean is accessable from my jsp page... i just need to know how to set up the array and return it.
Thanks again.