You have an error in your SQL syntax near 'FROM de_painting, WHERE de_painting.id_category = .id and .id' at line 6