are you sure you want a while statement? wouldn't an if work better? Why not filter at the SQL level and not worry about it. select * from paintings where category = 'oil' ---- Anthony Baratta President Keyboard Jockeys