MySQL Database Php

function selectMultiRows($query)
{
if((@$result = mysql_query ($query))==FALSE)
{
echo "Error in your query:
$query";
}
else
{
$count = 0;
$data = array();
while ( $row = mysql_fetch_array($result))
{
$data[$count] = $row;
$count++;
}
return $data;
}
}
/*
Usage Example
*/
$query = "select * from Users";
$returnedData = selectMultiRows($query);
$totalRecords = count($returnedData);
for($i=0;$i<$totalRecords;$i++)
{
echo $returnedData[$i]["username"] . "
";
}