I'm having a hard time to parse this PHP to JSON kan someone help me with this how can I convert this PHP into JSON
$query = "SELECT SUM(total) FROM account";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo $row['SUM(total)'];
}