check your syntax - Unknown column 'a' in 'where clause' - SELECT * FROM baiviet WHERE id=a ORDER BY id