Instead of fetching a row i think you might want to fetch associations
$goal = $result->fetch_assoc();
From documentation
- Returns an associative array that corresponds to the fetched row or NULL if there are no more rows.
fecth_row()
function you used will only return one row
- Fetches one row of data from the result set and returns it as an enumerated array, where each column is stored in an array offset starting from 0 (zero). Each subsequent call to this function will return the next row within the result set, or NULL if there are no more rows.