SELECT SQL_CALC_FOUND_ROWS name, color, value FROM plugin_chart_data WHERE chart_id = ORDER BY sort_value ASC

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 sort_value ASC' at line 1