Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
error code 0
04/01/2013
02:06
Avatar
hugosilvaonetag
Porto, Portugal
Member
Members
Forum Posts: 3
Member Since:
04/01/2013
sp_UserOfflineSmall Offline
 

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/edi.....p&#39;, 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…

what can it be, in the edit.php, i have put a echo json_encode("end"); , because i was trying to see if the problem was the missing json reponse, but the error appears the same…

help….

Thanks in advance

Hugo Silva

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
34 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information