Its less intensive to do it in MySQL, after all that's what databases are for, for you to manipulate data as you see fit.
@thewin
PHP Code:
for($iIndex=0; $iIndex<5; $iIndex++)
{
$result{$iIndex} = mysql_query("SELECT * FROM people WHERE id = '$number[$iIndex]'") or die(mysql_error());
$row{$iIndex} = mysql_fetch_array( $result{$iIndex} );
echo $row{$iIndex}[answer];
}
That'd work assuming its sequential data he wanted. It could be shortened to
PHP Code:
for($iIndex=0; $iIndex<5; $iIndex++)
{
$result= mysql_query("SELECT * FROM people WHERE id = '$number[$iIndex]'") or die(mysql_error());
$row = mysql_fetch_array( $result );
echo $row[answer];
}
So you wouldn't have to create 5 different values in memory as you only need the current one. Not much difference for 5 records but for 500? 5000? Notice that yours also queries the database 1 time for each record, if he needed 500 records that'd be 500 queries.
Looks like a red flag from x10's resources watchdogs :P