niladhar8@gmail.com
March 31st, 2011, 04:55 PM
sorry not sure if i can publish a question on mysql here...
on a query that returns n number of rows can i do it in a single statement instead of looping through...
right now this is what i do
while($data = mysql_fetch_array($res) )
{
$temp['name'][] = $data['name'];
$temp['state'][] = $data['state'];
$temp['street'][] = $data['street'];
$temp['number'][] = $data['number'];
}
cant i have mysql automatically put them all in an array for me?
on a query that returns n number of rows can i do it in a single statement instead of looping through...
right now this is what i do
while($data = mysql_fetch_array($res) )
{
$temp['name'][] = $data['name'];
$temp['state'][] = $data['state'];
$temp['street'][] = $data['street'];
$temp['number'][] = $data['number'];
}
cant i have mysql automatically put them all in an array for me?