Duplicate rows in CodeIgniter

Inserting to database is k. But then, database is returning same value twice! I tried many things. Don’t know, where I am going wrong. Please help. My code(view, controller, and model) is: View function customerBarCode(){ var itemCode=document.getElementById(‘customerbarcode’).value; $.ajax({ type:’POST’, data:({itemCode:itemCode}), url:”<?php echo base_url();?>inventory/itemMaster/customerBarCode_c”, success:function (data){ var data=jQuery.parseJSON(data); if (data.status==true){ alert(); var tabledata=data.tableData; var q=$(“#example-1”); $(“#example-1”).find(‘tbody’).empty();…

Details