Your sql should be ok but the select values look wrong:
<select name="order">
<option value="<?php echo $media_title;?>">Title</option>
<option value="<?php echo $rating;?>">Popular</option>
</select>
should probably be
<select name="order">
<option value="title">Title</option>
<option value="rating">Popular</option>
</select>
so it's the name of the database column that is passed as the 'order' - not the title of a book or a rating
You don't say what is wrong - also note mysql is now past its sell by date and you should look at mysqli or PDO