I'm working on a tutorial and copied the code below exactly but I'm getting the following error message. Any ideas what's wrong with the syntax? 

> 
> Database query failed: You have an
>  error in your SQL syntax; check the
>  manual that corresponds to your MySQL
>  server version for the right syntax to
>  use near 'BY position ASC' at line 2
> 
> 
> 

```
function get_pages_for_subject($subject_id, $public = true) {
            global $connection;
            $query = "SELECT * FROM pages WHERE subject_id = .$subject_id.";
            if ($public) {
                $query .= "AND visible = 1 ";
            }
            $query .= "ORDER BY position ASC";
            $page_set = mysql_query($query, $connection);
            confirm_query($page_set);
            return $page_set;
            }

```