Error Code 0 in edit form jquery grid
i am a newbie with php and im trying to use jquery grid, with the form edit, and delete.
I am implementing the edit , it is appearing – error Status: ‘error’. Error code: 0 ,when i press the submit button ,the error apears but the changes are made…
my grid…
<script>
var lastsel;
$(function() {
$("#toolbar").jqGrid({
mtype: 'POST',
editurl: 'http://www.onetag.pt/eulen/edit.php',
caption:"Tags",
colNames:['TagID','Nome', 'Descricao', 'Tipo'],
colModel:[
{name:'tagID',index:'tagID',hidden:true},
{name:'name',index:'name',editable:true},
{name:'description',index:'description',editable:true},
{name:'type',index:'type'}
],
datatype:"json",
height:421,
rownumWidth:40,
pager:'#ptoolbar',
rowList:[10,20,30],
rowNum:10,
sortname:'tagID',
sortorder:'desc',
url:'/tags/list/',
viewrecords:true,
width:740
});
$("#toolbar").jqGrid('navGrid','#ptoolbar',{del:true,add:false,edit:true,search:true});
$("#toolbar").jqGrid('filterToolbar',{stringResult:true,searchOnEnter:false});
});
</script>
and the editurl.php
<?php
// connect to the database
$dbhost = "localhost";
$dbuser = "blah";
$dbpassword = "blah";
$database = "blah";
$tablename = "tags";
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
//mysql_set_charset('utf8',$database);
mysql_query("SET NAMES 'utf8'");
if($_POST['oper']=='add')
{
}
if($_POST['oper']=='edit')
{
$id = mysql_real_escape_string($_POST['id']);
$name = mysql_real_escape_string($_POST['name']);
$description = mysql_real_escape_string($_POST['description']);
$sql = "UPDATE ".$tablename." SET name ='".$name."', description ='".$description."' WHERE tagID = ".$id;
$result=mysql_query($sql) or die(mysql_error());
mysql_close($db);
}
if($_POST['oper']=='del')
{
}
?>
i select the first row, and press edit button
then it appears the edit form…
then ive put the desired changes…
then press the submit button and the error appears…
i close the edit form, and press f5 to refresh, and the datafields have changed…
Total Views: 31 Today Views: 0














