<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: error code 0</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/error-code-0</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/error-code-0/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>hugosilvaonetag on error code 0</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/error-code-0#p27974</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/error-code-0#p27974</guid>
        	        	<description><![CDATA[<table style="height: 1494px;" border="0" width="638">
<tbody>
<tr>
<td class="votecell">&#160;</td>
<td class="postcell">
<div>
<div class="post-text">
<p>i am a newbie with php and im trying to use jquery grid, with  the form edit, and delete.</p>
<p>I am implementing the edit ,it is appearing &#8211;  error Status: &#39;error&#39;.  Error code: 0 ,when i press the submit</p>
<p>button ,the error apears but the  changes are made&#8230; my grid&#8230;</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit2473' value='Select Code' data-codeid='sfcode2473' /></p><div class='sfcode' id='sfcode2473'>&#60;script&#62;
var lastsel;
    $(function() {
        $(&#34;#toolbar&#34;).jqGrid({
            mtype: &#39;POST&#39;,
            editurl: &#39;<a rel=&#34;nofollow&#34; href=&#34;http://www.onetag.pt/eulen/edi&#34; target="_blank">http://www.onetag.pt/eulen/edi</a>.....p&#38;#39;, 
            caption:&#34;Tags&#34;,
            colNames:[&#39;TagID&#39;,&#39;Nome&#39;, &#39;Descricao&#39;, &#39;Tipo&#39;],
            colModel:[
            {name:&#39;tagID&#39;,index:&#39;tagID&#39;,hidden:true},
                {name:&#39;name&#39;,index:&#39;name&#39;,editable:true},
                {name:&#39;description&#39;,index:&#39;description&#39;,editable:true},
                {name:&#39;type&#39;,index:&#39;type&#39;}
            ],
            datatype:&#34;json
            height:421, 
            rownumWidth:40,
            pager:&#39;#ptoolbar&#39;,
            rowList:[10,20,30],
            rowNum:10,
            sortname:&#39;tagID&#39;,
            sortorder:&#39;desc&#39;,
            url:&#39;/tags/list/&#39;,
            viewrecords:true,
            width:740
        });
        $(&#34;#toolbar&#34;).jqGrid(&#39;navGrid&#39;,&#39;#ptoolbar&#39;,{del:true,add:false,edit:true,<br />search:true});
        $(&#34;#toolbar&#34;).jqGrid(&#39;filterToolbar&#39;,{stringResult:true,searchOnEnter:false});


    });
&#60;/script&#62;</div></pre>
<p>and the editurl.php</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit3672' value='Select Code' data-codeid='sfcode3672' /></p><div class='sfcode' id='sfcode3672'>&#60;?php

// connect to the database
$dbhost = &#34;localhost&#34;;
$dbuser = &#34;blah&#34;;
$dbpassword = &#34;blah&#34;;
$database = &#34;blah&#34;;
$tablename = &#34;tags&#34;;
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die(&#34;Connection Error: &#34; . mysql_error());

 mysql_select_db($database) or die(&#34;Error conecting to db.&#34;);
//mysql_set_charset(&#39;utf8&#39;,$database);
mysql_query(&#34;SET NAMES &#39;utf8&#39;&#34;);


 if($_POST[&#39;oper&#39;]==&#39;add&#39;)
 {

 }
 if($_POST[&#39;oper&#39;]==&#39;edit&#39;)
  {
$id     =   mysql_real_escape_string($_POST[&#39;id&#39;]);
$name     =   mysql_real_escape_string($_POST[&#39;name&#39;]);
$description   =   mysql_real_escape_string($_POST[&#39;description&#39;]);


$sql = &#34;UPDATE &#34;.$tablename.&#34; SET name =&#39;&#34;.$name.&#34;&#39;, description =&#39;&#34;.$description.&#34;&#39; WHERE <br />tagID = &#34;.$id;

 $result=mysql_query($sql) or die(mysql_error());

 mysql_close($db);


 }
 if($_POST[&#39;oper&#39;]==&#39;del&#39;)
 {

 } 
?&#62;  </div></pre>
<p>i select the first row,</p>
<p>and press edit button</p>
<p>then it appears the edit form&#8230;</p>
<p>then ive put the desired changes&#8230;</p>
<p>then press the submit button and the error appears&#8230;</p>
<p>i close the edit form, and press f5 to refresh, and the datafields have changed&#8230;</p>
</p>
<p>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&#8230;</p>
</p>
<p>help&#8230;.</p>
</p>
<p>Thanks in advance</p>
<p>Hugo Silva</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
]]></description>
        	        	<pubDate>Fri, 04 Jan 2013 02:06:06 +0200</pubDate>
        </item>
</channel>
</rss>