Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax;
$stages_sql = mysqli_query($conn, "SELECT * FROM stages WHERE course = " . mysqli_escape_string($conn, $assoc['name']));
$stages_sql = mysqli_query($conn,
"SELECT * FROM stages WHERE course = '"
. mysqli_escape_string($conn, $assoc['name'])
. "'");