SELECT *
FROM `custom_fields`
WHERE `belong_to` = 'students'
AND `visible_on_table` = 1
ORDER BY `custom_fields`.`weight` ASC