DataTables: How to send Data from input and select Fields using ajax





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I am stuck inside a problem I cannot handle easily.
I have create some fields (input and select) without using the <form> tag.
When the user click on the "Research" button starts the following script:




  • get all the value from the fields,


  • send all the fields to a Php page, using the DATATABLES plugin.
    Here is the code:



    function assetSearch() {



    var validation = checkForSelectedFields();



        if (validation == "KO")
    return;

    var arrForm = ;
    arrForm.push(document.getElementById("name").value);
    arrForm.push(document.getElementById("idConfig").value);
    arrForm.push(document.getElementById("serialNumber").value);
    arrForm.push(document.getElementById("tipo").value);
    arrForm.push(document.getElementById("ambiente").value);
    arrForm.push(document.getElementById("modello").value);
    arrForm.push(document.getElementById("locazione").value);
    arrForm.push(document.getElementById("vendor").value);
    arrForm.push(document.getElementById("gruppo").value);
    arrForm.push(document.getElementById("stato").value);
    arrForm.push(document.getElementById("classe").value);
    arrForm.push(document.getElementById("securityLevel").value);
    arrForm.push(document.getElementById("aggregatore").value);

    console.log(JSON.stringify(arrForm));

    var outcomeResearchTable = document.getElementById("OUTCOME_RESEARCH_TABLE");

    outcomeResearchTable.style.display = "flex";

    $('#OUTCOME_RESEARCH_TABLE').DataTable( {
    // "ajax": {
    // "url": "asset_GestAsset.php",
    // "type": "POST",
    // "data": function(d) {
    // d.form = $("#researchForm").serializeArray();
    // }
    //},
    "paging": true,
    "processing": true,
    "ajax": "asset_GestAsset.php",
    "deferLoading": 57,
    "deferRender": true,
    "scrollY": 350,
    "scrollX": true,
    "bRetrieve": true,
    "bDestroy": true,
    "iDisplayLength": 100,
    "ordering": false,
    "info": true,
    "sDom": 'ltipr',
    "order": [[1, 'asc']]
    } );


    }




non at all the fields are mandatory but at least one text input has to be compiled. The point is that Datatables, using the code shown previously, send me back an error: DataTables warning: table id=OUTCOME_RESEARCH_TABLE - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1



Just for test, I decided to try the query and show the values on the Datatable, so I decided to don't care about the Ajax problem but another the problem has come: Php tells me "OUT OF MEMORY". Looking at Google Developer Console I have been informed that under the column: STATUS (inside Network) the php page is in "pending" for about 30seconds and the error is:




Fatal error: Out of memory (allocated 559939584) (tried to
allocate 25165832 bytes) in




<?php

ini_set('memory_limit', '-1');
include("function.php");

$conn = connectionDB();

$queryOriginale = " select A.ID_CONFIG IDCONF, A.ID_ASSET IDASSET, A.NOME NOME,B.SERIAL_NUMBER SERIALNUMBER, B.TIPO TIPOLOGIA, C.DESCRIZIONE STATO, E.NOME AGGREGATORE,
F.ID_CED,F.SALA,F.FILA,F.POSIZIONE,D.NOME AMBIENTE , H.NOME MODELLO, G.DESCRIZIONE NOMECED, 'n/a' CONTRATTO, A.VALIDA_DAL VALIDADAL,A.VALIDA_AL VALIDAAL
from
PCMDB_INV.ASSET B, PCMDB_INV.CONFIG A, PCMDB_INV.STATO C, PCMDB_INV.AMBIENTE D,
PCMDB_INV.AGGREGATOR E, PCMDB_INV.LOCAZIONE F, PCMDB_INV.CED G, PCMDB_INV.MODELLO H,
PCMDB_INV.SOFTWARE L, PCMDB_INV.SW_CONFIG O, PCMDB_INV.GRUPPO M, PCMDB_INV.TECH_APPLICATION N,
PCMDB_INV.SECURITY_LEVEL P, PCMDB_INV.SEC_LEVEL_CONFIG Q";

$SSS = oci_parse($conn, $queryOriginale);
oci_execute($SSS);
$NUM = oci_fetch_all($SSS, $res);


$stid = oci_parse($conn, $queryOriginale);
oci_execute($stid);

$i = 0;
echo "{ "aaData": [n";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
$i++;

$a = trim($row["IDCONF"]);
$b = trim($row["NOME"]);
$c = trim($row["TIPOLOGIA"]);
$d = trim($row["STATO"]);
$e = trim($row["AMBIENTE"]);
$f = trim($row["AGGREGATORE"]);
$f2 = trim($row["NOMECED"]);
$g = trim($row["MODELLO"]);
$h = trim($row["CONTRATTO"]);
$l = trim($row["VALIDADAL"]);
$m = trim($row["VALIDAAL"]);

if ($i < $NUM){
echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ], n";
}else {
echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ]n";
}
}
echo "] }";
?>


Someone could help me to solve both of the problems?
Many thanks in advance










share|improve this question





























    1















    I am stuck inside a problem I cannot handle easily.
    I have create some fields (input and select) without using the <form> tag.
    When the user click on the "Research" button starts the following script:




    • get all the value from the fields,


    • send all the fields to a Php page, using the DATATABLES plugin.
      Here is the code:



      function assetSearch() {



      var validation = checkForSelectedFields();



          if (validation == "KO")
      return;

      var arrForm = ;
      arrForm.push(document.getElementById("name").value);
      arrForm.push(document.getElementById("idConfig").value);
      arrForm.push(document.getElementById("serialNumber").value);
      arrForm.push(document.getElementById("tipo").value);
      arrForm.push(document.getElementById("ambiente").value);
      arrForm.push(document.getElementById("modello").value);
      arrForm.push(document.getElementById("locazione").value);
      arrForm.push(document.getElementById("vendor").value);
      arrForm.push(document.getElementById("gruppo").value);
      arrForm.push(document.getElementById("stato").value);
      arrForm.push(document.getElementById("classe").value);
      arrForm.push(document.getElementById("securityLevel").value);
      arrForm.push(document.getElementById("aggregatore").value);

      console.log(JSON.stringify(arrForm));

      var outcomeResearchTable = document.getElementById("OUTCOME_RESEARCH_TABLE");

      outcomeResearchTable.style.display = "flex";

      $('#OUTCOME_RESEARCH_TABLE').DataTable( {
      // "ajax": {
      // "url": "asset_GestAsset.php",
      // "type": "POST",
      // "data": function(d) {
      // d.form = $("#researchForm").serializeArray();
      // }
      //},
      "paging": true,
      "processing": true,
      "ajax": "asset_GestAsset.php",
      "deferLoading": 57,
      "deferRender": true,
      "scrollY": 350,
      "scrollX": true,
      "bRetrieve": true,
      "bDestroy": true,
      "iDisplayLength": 100,
      "ordering": false,
      "info": true,
      "sDom": 'ltipr',
      "order": [[1, 'asc']]
      } );


      }




    non at all the fields are mandatory but at least one text input has to be compiled. The point is that Datatables, using the code shown previously, send me back an error: DataTables warning: table id=OUTCOME_RESEARCH_TABLE - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1



    Just for test, I decided to try the query and show the values on the Datatable, so I decided to don't care about the Ajax problem but another the problem has come: Php tells me "OUT OF MEMORY". Looking at Google Developer Console I have been informed that under the column: STATUS (inside Network) the php page is in "pending" for about 30seconds and the error is:




    Fatal error: Out of memory (allocated 559939584) (tried to
    allocate 25165832 bytes) in




    <?php

    ini_set('memory_limit', '-1');
    include("function.php");

    $conn = connectionDB();

    $queryOriginale = " select A.ID_CONFIG IDCONF, A.ID_ASSET IDASSET, A.NOME NOME,B.SERIAL_NUMBER SERIALNUMBER, B.TIPO TIPOLOGIA, C.DESCRIZIONE STATO, E.NOME AGGREGATORE,
    F.ID_CED,F.SALA,F.FILA,F.POSIZIONE,D.NOME AMBIENTE , H.NOME MODELLO, G.DESCRIZIONE NOMECED, 'n/a' CONTRATTO, A.VALIDA_DAL VALIDADAL,A.VALIDA_AL VALIDAAL
    from
    PCMDB_INV.ASSET B, PCMDB_INV.CONFIG A, PCMDB_INV.STATO C, PCMDB_INV.AMBIENTE D,
    PCMDB_INV.AGGREGATOR E, PCMDB_INV.LOCAZIONE F, PCMDB_INV.CED G, PCMDB_INV.MODELLO H,
    PCMDB_INV.SOFTWARE L, PCMDB_INV.SW_CONFIG O, PCMDB_INV.GRUPPO M, PCMDB_INV.TECH_APPLICATION N,
    PCMDB_INV.SECURITY_LEVEL P, PCMDB_INV.SEC_LEVEL_CONFIG Q";

    $SSS = oci_parse($conn, $queryOriginale);
    oci_execute($SSS);
    $NUM = oci_fetch_all($SSS, $res);


    $stid = oci_parse($conn, $queryOriginale);
    oci_execute($stid);

    $i = 0;
    echo "{ "aaData": [n";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    $i++;

    $a = trim($row["IDCONF"]);
    $b = trim($row["NOME"]);
    $c = trim($row["TIPOLOGIA"]);
    $d = trim($row["STATO"]);
    $e = trim($row["AMBIENTE"]);
    $f = trim($row["AGGREGATORE"]);
    $f2 = trim($row["NOMECED"]);
    $g = trim($row["MODELLO"]);
    $h = trim($row["CONTRATTO"]);
    $l = trim($row["VALIDADAL"]);
    $m = trim($row["VALIDAAL"]);

    if ($i < $NUM){
    echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ], n";
    }else {
    echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ]n";
    }
    }
    echo "] }";
    ?>


    Someone could help me to solve both of the problems?
    Many thanks in advance










    share|improve this question

























      1












      1








      1








      I am stuck inside a problem I cannot handle easily.
      I have create some fields (input and select) without using the <form> tag.
      When the user click on the "Research" button starts the following script:




      • get all the value from the fields,


      • send all the fields to a Php page, using the DATATABLES plugin.
        Here is the code:



        function assetSearch() {



        var validation = checkForSelectedFields();



            if (validation == "KO")
        return;

        var arrForm = ;
        arrForm.push(document.getElementById("name").value);
        arrForm.push(document.getElementById("idConfig").value);
        arrForm.push(document.getElementById("serialNumber").value);
        arrForm.push(document.getElementById("tipo").value);
        arrForm.push(document.getElementById("ambiente").value);
        arrForm.push(document.getElementById("modello").value);
        arrForm.push(document.getElementById("locazione").value);
        arrForm.push(document.getElementById("vendor").value);
        arrForm.push(document.getElementById("gruppo").value);
        arrForm.push(document.getElementById("stato").value);
        arrForm.push(document.getElementById("classe").value);
        arrForm.push(document.getElementById("securityLevel").value);
        arrForm.push(document.getElementById("aggregatore").value);

        console.log(JSON.stringify(arrForm));

        var outcomeResearchTable = document.getElementById("OUTCOME_RESEARCH_TABLE");

        outcomeResearchTable.style.display = "flex";

        $('#OUTCOME_RESEARCH_TABLE').DataTable( {
        // "ajax": {
        // "url": "asset_GestAsset.php",
        // "type": "POST",
        // "data": function(d) {
        // d.form = $("#researchForm").serializeArray();
        // }
        //},
        "paging": true,
        "processing": true,
        "ajax": "asset_GestAsset.php",
        "deferLoading": 57,
        "deferRender": true,
        "scrollY": 350,
        "scrollX": true,
        "bRetrieve": true,
        "bDestroy": true,
        "iDisplayLength": 100,
        "ordering": false,
        "info": true,
        "sDom": 'ltipr',
        "order": [[1, 'asc']]
        } );


        }




      non at all the fields are mandatory but at least one text input has to be compiled. The point is that Datatables, using the code shown previously, send me back an error: DataTables warning: table id=OUTCOME_RESEARCH_TABLE - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1



      Just for test, I decided to try the query and show the values on the Datatable, so I decided to don't care about the Ajax problem but another the problem has come: Php tells me "OUT OF MEMORY". Looking at Google Developer Console I have been informed that under the column: STATUS (inside Network) the php page is in "pending" for about 30seconds and the error is:




      Fatal error: Out of memory (allocated 559939584) (tried to
      allocate 25165832 bytes) in




      <?php

      ini_set('memory_limit', '-1');
      include("function.php");

      $conn = connectionDB();

      $queryOriginale = " select A.ID_CONFIG IDCONF, A.ID_ASSET IDASSET, A.NOME NOME,B.SERIAL_NUMBER SERIALNUMBER, B.TIPO TIPOLOGIA, C.DESCRIZIONE STATO, E.NOME AGGREGATORE,
      F.ID_CED,F.SALA,F.FILA,F.POSIZIONE,D.NOME AMBIENTE , H.NOME MODELLO, G.DESCRIZIONE NOMECED, 'n/a' CONTRATTO, A.VALIDA_DAL VALIDADAL,A.VALIDA_AL VALIDAAL
      from
      PCMDB_INV.ASSET B, PCMDB_INV.CONFIG A, PCMDB_INV.STATO C, PCMDB_INV.AMBIENTE D,
      PCMDB_INV.AGGREGATOR E, PCMDB_INV.LOCAZIONE F, PCMDB_INV.CED G, PCMDB_INV.MODELLO H,
      PCMDB_INV.SOFTWARE L, PCMDB_INV.SW_CONFIG O, PCMDB_INV.GRUPPO M, PCMDB_INV.TECH_APPLICATION N,
      PCMDB_INV.SECURITY_LEVEL P, PCMDB_INV.SEC_LEVEL_CONFIG Q";

      $SSS = oci_parse($conn, $queryOriginale);
      oci_execute($SSS);
      $NUM = oci_fetch_all($SSS, $res);


      $stid = oci_parse($conn, $queryOriginale);
      oci_execute($stid);

      $i = 0;
      echo "{ "aaData": [n";
      while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
      $i++;

      $a = trim($row["IDCONF"]);
      $b = trim($row["NOME"]);
      $c = trim($row["TIPOLOGIA"]);
      $d = trim($row["STATO"]);
      $e = trim($row["AMBIENTE"]);
      $f = trim($row["AGGREGATORE"]);
      $f2 = trim($row["NOMECED"]);
      $g = trim($row["MODELLO"]);
      $h = trim($row["CONTRATTO"]);
      $l = trim($row["VALIDADAL"]);
      $m = trim($row["VALIDAAL"]);

      if ($i < $NUM){
      echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ], n";
      }else {
      echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ]n";
      }
      }
      echo "] }";
      ?>


      Someone could help me to solve both of the problems?
      Many thanks in advance










      share|improve this question














      I am stuck inside a problem I cannot handle easily.
      I have create some fields (input and select) without using the <form> tag.
      When the user click on the "Research" button starts the following script:




      • get all the value from the fields,


      • send all the fields to a Php page, using the DATATABLES plugin.
        Here is the code:



        function assetSearch() {



        var validation = checkForSelectedFields();



            if (validation == "KO")
        return;

        var arrForm = ;
        arrForm.push(document.getElementById("name").value);
        arrForm.push(document.getElementById("idConfig").value);
        arrForm.push(document.getElementById("serialNumber").value);
        arrForm.push(document.getElementById("tipo").value);
        arrForm.push(document.getElementById("ambiente").value);
        arrForm.push(document.getElementById("modello").value);
        arrForm.push(document.getElementById("locazione").value);
        arrForm.push(document.getElementById("vendor").value);
        arrForm.push(document.getElementById("gruppo").value);
        arrForm.push(document.getElementById("stato").value);
        arrForm.push(document.getElementById("classe").value);
        arrForm.push(document.getElementById("securityLevel").value);
        arrForm.push(document.getElementById("aggregatore").value);

        console.log(JSON.stringify(arrForm));

        var outcomeResearchTable = document.getElementById("OUTCOME_RESEARCH_TABLE");

        outcomeResearchTable.style.display = "flex";

        $('#OUTCOME_RESEARCH_TABLE').DataTable( {
        // "ajax": {
        // "url": "asset_GestAsset.php",
        // "type": "POST",
        // "data": function(d) {
        // d.form = $("#researchForm").serializeArray();
        // }
        //},
        "paging": true,
        "processing": true,
        "ajax": "asset_GestAsset.php",
        "deferLoading": 57,
        "deferRender": true,
        "scrollY": 350,
        "scrollX": true,
        "bRetrieve": true,
        "bDestroy": true,
        "iDisplayLength": 100,
        "ordering": false,
        "info": true,
        "sDom": 'ltipr',
        "order": [[1, 'asc']]
        } );


        }




      non at all the fields are mandatory but at least one text input has to be compiled. The point is that Datatables, using the code shown previously, send me back an error: DataTables warning: table id=OUTCOME_RESEARCH_TABLE - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1



      Just for test, I decided to try the query and show the values on the Datatable, so I decided to don't care about the Ajax problem but another the problem has come: Php tells me "OUT OF MEMORY". Looking at Google Developer Console I have been informed that under the column: STATUS (inside Network) the php page is in "pending" for about 30seconds and the error is:




      Fatal error: Out of memory (allocated 559939584) (tried to
      allocate 25165832 bytes) in




      <?php

      ini_set('memory_limit', '-1');
      include("function.php");

      $conn = connectionDB();

      $queryOriginale = " select A.ID_CONFIG IDCONF, A.ID_ASSET IDASSET, A.NOME NOME,B.SERIAL_NUMBER SERIALNUMBER, B.TIPO TIPOLOGIA, C.DESCRIZIONE STATO, E.NOME AGGREGATORE,
      F.ID_CED,F.SALA,F.FILA,F.POSIZIONE,D.NOME AMBIENTE , H.NOME MODELLO, G.DESCRIZIONE NOMECED, 'n/a' CONTRATTO, A.VALIDA_DAL VALIDADAL,A.VALIDA_AL VALIDAAL
      from
      PCMDB_INV.ASSET B, PCMDB_INV.CONFIG A, PCMDB_INV.STATO C, PCMDB_INV.AMBIENTE D,
      PCMDB_INV.AGGREGATOR E, PCMDB_INV.LOCAZIONE F, PCMDB_INV.CED G, PCMDB_INV.MODELLO H,
      PCMDB_INV.SOFTWARE L, PCMDB_INV.SW_CONFIG O, PCMDB_INV.GRUPPO M, PCMDB_INV.TECH_APPLICATION N,
      PCMDB_INV.SECURITY_LEVEL P, PCMDB_INV.SEC_LEVEL_CONFIG Q";

      $SSS = oci_parse($conn, $queryOriginale);
      oci_execute($SSS);
      $NUM = oci_fetch_all($SSS, $res);


      $stid = oci_parse($conn, $queryOriginale);
      oci_execute($stid);

      $i = 0;
      echo "{ "aaData": [n";
      while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
      $i++;

      $a = trim($row["IDCONF"]);
      $b = trim($row["NOME"]);
      $c = trim($row["TIPOLOGIA"]);
      $d = trim($row["STATO"]);
      $e = trim($row["AMBIENTE"]);
      $f = trim($row["AGGREGATORE"]);
      $f2 = trim($row["NOMECED"]);
      $g = trim($row["MODELLO"]);
      $h = trim($row["CONTRATTO"]);
      $l = trim($row["VALIDADAL"]);
      $m = trim($row["VALIDAAL"]);

      if ($i < $NUM){
      echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ], n";
      }else {
      echo "[ "".$a."", "".$b."", "".$c."", "".$d."", "".$e."", "".$f."", "".$f2."", "".$g."", "".$h."", "".$l."", "".$m."" ]n";
      }
      }
      echo "] }";
      ?>


      Someone could help me to solve both of the problems?
      Many thanks in advance







      php jquery datatable






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 11:21









      EmilioEmilio

      328




      328
























          1 Answer
          1






          active

          oldest

          votes


















          1














          while (($row = oci_fetch_array($stid, OCI_BOTH)) != false) {



          this should help with the "out of memory" problem.



          additional information: (think about it)



          native js:



          var form = document.querySelector('form');
          var data = new FormData(form);
          var req = new XMLHttpRequest();
          req.send(data);


          reference



          jQuery:



          $( "form" ).on( "submit", function( event ) {
          event.preventDefault();
          console.log( $( this ).serialize() );
          });


          reference



          have a nice one






          share|improve this answer
























          • Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

            – Emilio
            Nov 23 '18 at 11:34











          • Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

            – Emilio
            Nov 23 '18 at 11:35














          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53445771%2fdatatables-how-to-send-data-from-input-and-select-fields-using-ajax%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          while (($row = oci_fetch_array($stid, OCI_BOTH)) != false) {



          this should help with the "out of memory" problem.



          additional information: (think about it)



          native js:



          var form = document.querySelector('form');
          var data = new FormData(form);
          var req = new XMLHttpRequest();
          req.send(data);


          reference



          jQuery:



          $( "form" ).on( "submit", function( event ) {
          event.preventDefault();
          console.log( $( this ).serialize() );
          });


          reference



          have a nice one






          share|improve this answer
























          • Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

            – Emilio
            Nov 23 '18 at 11:34











          • Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

            – Emilio
            Nov 23 '18 at 11:35


















          1














          while (($row = oci_fetch_array($stid, OCI_BOTH)) != false) {



          this should help with the "out of memory" problem.



          additional information: (think about it)



          native js:



          var form = document.querySelector('form');
          var data = new FormData(form);
          var req = new XMLHttpRequest();
          req.send(data);


          reference



          jQuery:



          $( "form" ).on( "submit", function( event ) {
          event.preventDefault();
          console.log( $( this ).serialize() );
          });


          reference



          have a nice one






          share|improve this answer
























          • Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

            – Emilio
            Nov 23 '18 at 11:34











          • Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

            – Emilio
            Nov 23 '18 at 11:35
















          1












          1








          1







          while (($row = oci_fetch_array($stid, OCI_BOTH)) != false) {



          this should help with the "out of memory" problem.



          additional information: (think about it)



          native js:



          var form = document.querySelector('form');
          var data = new FormData(form);
          var req = new XMLHttpRequest();
          req.send(data);


          reference



          jQuery:



          $( "form" ).on( "submit", function( event ) {
          event.preventDefault();
          console.log( $( this ).serialize() );
          });


          reference



          have a nice one






          share|improve this answer













          while (($row = oci_fetch_array($stid, OCI_BOTH)) != false) {



          this should help with the "out of memory" problem.



          additional information: (think about it)



          native js:



          var form = document.querySelector('form');
          var data = new FormData(form);
          var req = new XMLHttpRequest();
          req.send(data);


          reference



          jQuery:



          $( "form" ).on( "submit", function( event ) {
          event.preventDefault();
          console.log( $( this ).serialize() );
          });


          reference



          have a nice one







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 '18 at 11:30









          netzdingnetzding

          240111




          240111













          • Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

            – Emilio
            Nov 23 '18 at 11:34











          • Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

            – Emilio
            Nov 23 '18 at 11:35





















          • Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

            – Emilio
            Nov 23 '18 at 11:34











          • Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

            – Emilio
            Nov 23 '18 at 11:35



















          Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

          – Emilio
          Nov 23 '18 at 11:34





          Using OCI_BOTH and != false helped me reducing the time from 30seconds to less (I still receive the error: Fatal error: Out of memory (allocated 251658240) (tried to allocate 12582920 bytes) in C:xampphtdocs\asset_GestAsset.php on line 18 )

          – Emilio
          Nov 23 '18 at 11:34













          Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

          – Emilio
          Nov 23 '18 at 11:35







          Second, your suggestions doesn't consider how to deal with the DataTable. Anyway thank you for your tips! :)

          – Emilio
          Nov 23 '18 at 11:35






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53445771%2fdatatables-how-to-send-data-from-input-and-select-fields-using-ajax%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Paul Cézanne

          UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

          Angular material date-picker (MatDatepicker) auto completes the date on focus out