this code above inserts the same content upto 70 times(ie into 70 rows) in a database instead of just once.
please what could be the problem
Code:
<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
helpdesk.request('tickets',{ per_page: '90'}).then(function(data){
$.each(data.tickets, function(index, ticket){
// save to database
$.post("save.php",
{
t_id: ticket_id,
t_name: ticket_name
},
function(data,status){
alert("Data: " + data + "\nStatus: " + status);
});
});
});
});
</script>
Bookmarks