Zenon

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • in reply to: Example to the save of data in the database #82535
    Zenon
    Participant

    Thank you, you were right, everything works.

    in reply to: Example to the save of data in the database #82436
    Zenon
    Participant

    edit.php

    include("dbconfig.php");

    $uniqrow = $_GET; // this is id of grid
    $date_inv = $_GET; // this is the name attr from colModel
    $clientname = $_GET; // this is a name attr from colModel

    // connect to the database
    $db = mysql_connect($dbhost, $dbuser, $dbpassword)
    or die("Connection Error: " . mysql_error());

    mysql_select_db($database) or die("Error conecting to db.");

    $SQL = "UPDATE invheader set invdate='".$date_inv."', name ='".$clientname."' WHERE id=".$uniqrow;

    mysql_query($SQL)or die("Error execute SQL.");
    mysql_close($db);

    in reply to: Example to the save of data in the database #82435
    Zenon
    Participant

    these are my files:
    rowedex1.js

    jQuery("#rowed1").jqGrid({
    url:'server.php?q=2',
    datatype: "json",
    colNames:,
    colModel:[
    {name:'id',index:'id', width:55},
    {name:'invdate',index:'invdate', width:90, editable:true},
    {name:'name',index:'name', width:100,editable:true},
    {name:'amount',index:'amount', width:80, align:"right",editable:true},
    {name:'tax',index:'tax', width:80, align:"right",editable:true},
    {name:'total',index:'total', width:80,align:"right",editable:true},
    {name:'note',index:'note', width:150, sortable:false,editable:true}
    ],
    rowNum:10,
    rowList:[10,20,30],
    imgpath: gridimgpath,
    pager: jQuery('#prowed1'),
    sortname: 'id',
    viewrecords: true,
    sortorder: "desc",
    editurl: 'edit.php',
    caption: "Basic Example"
    });
    jQuery("#ed1").click( function() {
    jQuery("#rowed1").editRow("13");
    this.disabled = 'true';
    jQuery("#sved1,#cned1").attr("disabled",false);
    });
    jQuery("#sved1").click( function() {
    jQuery("#rowed1").saveRow("13");
    jQuery("#sved1,#cned1").attr("disabled",true);
    jQuery("#ed1").attr("disabled",false);
    });
    jQuery("#cned1").click( function() {
    jQuery("#rowed1").restoreRow("13");
    jQuery("#sved1,#cned1").attr("disabled",true);
    jQuery("#ed1").attr("disabled",false);
    });
    jQuery("#rowed1").navGrid("#prowed1",{edit:false,add:false,del:false});

    and edit.php

    record is not stored in the mysql database, what I am doing wrong?

Viewing 3 replies - 1 through 3 (of 3 total)

Stay connected with us in your favorite flavor!