Proper Value to Return to success function from program

Proper Value to Return to success function from program

This is the ajax function I've been working with - it works fine, all data is being sent back, parsed and written into the correct databases

  1.     
  2. <script type="text/javascript">
  3. $(function()
  4. {
  5.     $('#submitButton').click(function(){
  6.         var reservations = $("#main_table table input[name=name]:checked").map(function() {
  7.                 row = $(this).closest("tr");
  8.                 return { 
  9.                          recordid    : $(row).find('input[name=record_id]').val(),
  10.                          firstname   : $(row).find('input[name=firstname]').val(),
  11.                          lastname    : $(row).find('input[name=lastname]').val(),
  12.                          timeneeded  : $(row).find('input[name=timeneeded]').val(),
  13.                          dateneeded  : $(row).find('input[name=dateneeded]').val(),       
  14.                          pickup      : $(row).find('input[name=pickup]').val(),       
  15.                          dropoff     : $(row).find('input[name=dropoff]').val(),       
  16.                          pxdriver    : $(row).find('td:eq(7)').text()
  17.                         }
  18.             }).get();
  19.         console.log(reservations);
  20. infotosend = JSON.stringify(reservations);
  21.      $.ajax({
  22. type: "POST",
  23. url: "create_assignments.php",
  24. data: {data : infotosend},
  25. dataType: 'json',
  26. cache: false,
  27. timeout: 100000,
  28. success: function (data) {

  29. console.log("SUCCESS : ", data);

  30. },
  31. error: function (e) {

  32. console.log("ERROR : ", e);

  33. }
  34. });
  35.     });
  36. });

  37. </script>
  38. When I look at the console output, it shows status:200, statusText="OK", but it also shows that it has returned to the error:function and throws ERROR to the console.  What am I missing?  I've been trying to go through the API documentation and am building a better knowledge base, but I can't seem to find this answer.
  39. Thank you