'Does ORDER BY and WHERE clause have different precedence?

I am currently fetching data using the statement

$queryfetchBookings="SELECT `id`,`sessionHeld`,`fk_student_id`,`channelName`,`video_duration`,`audio_duration`,`category`,`dateBooked`,`timeSlot`,`duration`,`category`,`studentName`,`overallRating`,`chat_duration`  FROM `one_to_one_bookings` WHERE fk_co_id=".$co_id;

I now want to add an

 ORDER BY `id` ASC 

to the end but whatever variation I have tried results in failure.(Does not fetch data). Need advice on how to proceed.

Different variations that i have tried: enter image description here



Solution 1:[1]

I am not sure about how the server you are using works, but in oracle it would not work because after the WHERE clause you are adding a ";". At least in oracle this would mean that the query is over, so I am guessing this is why it is not considering your last sentence. I hope I can help :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel Pérez Lozano