I want to use database data and send it to a PHP script using JQuery's AJAX. How would I achieve this?
Here's the code so far:
function update(id) {
  $("#update").click(function() {
    $.ajax({
      type: 'POST',
      url: '<?= base_url("event/update_event_view"); ?>',
      data: {'id': id},
      dataType: 'json',
      success: function(retval) {
        $('#display').hide();
        $('#up').show();
        $('#up').html(retval[0]);
      }
    });
  });
}