What's wrong with my SELECT? (basic)

Hi guys,

I have error in my SELECT query.

$query = $this->db->query("SELECT classid, nameclass FROM classes WHERE pathwayid = $pathwayid ORDER BY nameclass ASC");

And the error was,

Error Number: 1064

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 'ORDER BY nameclass ASC' at line 1

I know the error is very basic, Sorry but I forgot…

Thanks in advance.

The codes above is correct.
I forgot to put the $pathwayid into session.

Problem solved!