Editable DataTables Fails To Update After An Add

Editable DataTables Fails To Update After An Add

sdbrown_solumacsdbrown_solumac Posts: 5Questions: 0Answers: 0
edited March 2012 in General
The database updates from the ajax call, I return the id of the record in the database as the documentation instructs but the table is updated with a row containing none or garballed data. After the page is refreshed the row shows correctly. I get the error...

[code]DataTables warning (table id = 'tableLocation'): Requested unknown parameter '1' from the data source for row 12[/code]

Anyone know what this is?

Replies

  • sdbrown_solumacsdbrown_solumac Posts: 5Questions: 0Answers: 0
    Example of the Ajax Service:

    [code]
    <?php
    //updateLocation.php

    include_once 'config/site.php';

    $id = 0;
    $fld1 = $_REQUEST['fld1'];
    $fld2 = $_REQUEST['fld2'];
    $fld3 = $_REQUEST['fld3'];
    $fld4 = $_REQUEST['fld4'];
    $fld5 = $_REQUEST['fld5'];
    $fld6 = $_REQUEST['fld6'];
    $fld7 = date ("Y-m-d H:m:s");

    $con = mysql_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD);
    $found = mysql_select_db(DB_DATABASE);

    if ($found) {
    $mysql = "INSERT INTO geo (geo_id, geo_fld1, geo_fld2, geo_fld3, geo_fld4, geo_fld5, geo_fld6, geo_fld7) VALUES (";
    $mysql .= $id.", ".$fld1.", '".$fld2."', '".$fld3."', '".$fld4."', ".$fld5.", ".$fld6.", '".$fld7."');";
    $result = mysql_query($mysql);
    if ($result) {
    $id = mysql_insert_id();
    echo $id;
    }
    }
    [/code]
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    http://datatables.net/faqs#unknown_parameter :-)

    Allan
This discussion has been closed.