In your table (tbl_item ), the rowdata itemid appears more than twice. You can use more precise filtering conditions to avoid these duplicates