A function is it's own little world, nothing from outside can be seen or changed from within. Only way to see it is to send it in as a parameter or set the variable as global (setting as parameter is prefered though)
PHP Code:
function QueryVars($start, $end, $row)
{
$question = array();
for($i=$start ; $i <= $end; $i++)
{
$question[$i] = $row["quest_".$i];
}
return $question;
}
$sql = "QUERY";//QUERY is a sub for my actual SQL
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$question = QueryVars(1, 21, $row);
var_dump($question);
Bookmarks