<?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: Dont Update in mysql</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dont-update-in-mysql</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/dont-update-in-mysql/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>elmerald on Dont Update in mysql</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dont-update-in-mysql#p21182</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dont-update-in-mysql#p21182</guid>
        	        	<description><![CDATA[<p>Hi, excuse my bad english.</p>
<p>I use a model edit but dont update the values.</p>
<p>the code is</p>
<p>js code</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8716' value='Select Code' data-codeid='sfcode8716' /></p>
<div class='sfcode' id='sfcode8716'>jQuery(&#34;#navgrid&#34;).jqGrid({<br />&#160; &#160;&#160;&#160; &#160;url:&#39;abilita.php?q=1&#39;,<br />&#160;&#160; &#160;datatype: &#34;xml&#34;,<br />&#160; &#160;&#160;&#160; &#160;colNames:[&#39;Partita Iva&#39;,&#39;Ragione Sociale&#39;, &#39;Utente&#39;,&#39;Indirizzo&#39;,&#39;Citt&#38;agrave;&#39;,&#39;Cap&#39;,&#39;Provincia&#39;,&#39;Telefono&#39;,&#39;Email&#39;,&#39;Attivo&#39;,&#39;Cancellato&#39;],<br />&#160; &#160;&#160;&#160; &#160;colModel:[<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;iva&#39;,index:&#39;iva&#39;, width:110,editable:false,editoptions:{size:10}},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;descrizione&#39;,index:&#39;descrizione&#39;, width:110,editable:false,editoptions:{size:10}},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;utente&#39;,index:&#39;utente&#39;, width:90,editable:false,editoptions:{size:15}},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;indirizzo&#39;,index:&#39;indirizzo&#39;, width:110, align:&#34;right&#34;,editable:false,editoptions:{size:10}},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;citta&#39;,index:&#39;citta&#39;, width:110, align:&#34;right&#34;,editable:false,editoptions:{size:10}},&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;cap&#39;,index:&#39;cap&#39;, width:40,align:&#34;right&#34;,editable:false,editoptions:{size:10}},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;provincia&#39;,index:&#39;provincia&#39;, width:60,align:&#34;right&#34;,editable:false,editoptions:{size:10}},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;telefono&#39;,index:&#39;telefono&#39;, width:90,align:&#34;right&#34;,editable:false,editoptions:{size:10}},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;email&#39;,index:&#39;email&#39;, width:160,align:&#34;right&#34;,editable:false,editoptions:{size:10}},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;attivo&#39;,index:&#39;attivo&#39;,width:55,align:&#39;center&#39;,editable:true,edittype:&#34;checkbox&#34;,editoptions:{value:&#34;Yes:1;No:0&#34;}},<br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;cancellato&#39;,index:&#39;cancellato&#39;,width:60,align:&#39;center&#39;,editable:true,edittype:&#34;checkbox&#34;,editoptions:{value:&#34;Yes:1;No:0&#34;}}&#160;&#160; &#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;],<br />&#160; &#160;&#160;&#160; &#160;rowNum:10,<br />&#160; &#160;&#160;&#160; &#160;rowList:[10,20,30],<br />&#160; &#160;&#160;&#160; &#160;pager: &#39;#pagernav&#39;,<br />&#160; &#160;&#160;&#160; &#160;sortname: &#39;iva&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; sortorder: &#34;asc&#34;,<br />&#160;&#160; &#160;width: 690, <br />&#160;&#160; &#160;shrinkToFit: false,<br />&#160;&#160; &#160;height: &#34;100%&#34;,<br />&#160;&#160;&#160; caption:&#34;Utenti d&#39;abilitare&#34;,<br />&#160;&#160;&#160; editurl:&#34;abilitare.php&#34;<br />&#160;&#160; &#160;<br />});<br />jQuery(&#34;#navgrid&#34;).jqGrid(&#39;navGrid&#39;,&#39;#pagernav&#39;,{edit:true,add:false,del:false,search:false}, <br />{}, //options<br />{height:&#39;auto&#39;,reloadAfterSubmit:true}, // edit options<br />{height:540,reloadAfterSubmit:false}, // add options<br />{reloadAfterSubmit:false}, // del options<br />{} // search options<br />);</div>
<p>php code</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9058' value='Select Code' data-codeid='sfcode9058' /></p>
<div class='sfcode' id='sfcode9058'>&#60;?php<br />include(&#39;../inc/db.php&#39;);<br />if (isset($_POST[&#34;oper&#34;])) {<br />&#160;&#160;&#160; if ($_POST[&#34;oper&#34;] == &#34;add&#34;) {<br />&#160;&#160;&#160; } elseif ($_POST[&#34;oper&#34;] == &#34;edit&#34;) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $editSQL = sprintf(&#34;update clienti set attivo = %s, cancellato = %s<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; where iva = %s and utente = %s&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GetSQLValueString($_POST[&#39;attivo&#39;], &#34;int&#34;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GetSQLValueString($_POST[&#39;cancellato&#39;], &#34;int&#34;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GetSQLValueString($_POST[&#39;iva&#39;], &#34;text&#34;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GetSQLValueString($_POST[&#39;utente&#39;], &#34;text&#34;));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Result = mysql_query( $editSQL ) or die(&#34;Couldn t execute query.&#34;.mysql_error());<br />&#160;&#160;&#160; } elseif ($_POST[&#34;oper&#34;] == &#34;del&#34;) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $deleteSQL = sprintf(&#34;delete from users where idusers = %s&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GetSQLValueString($_POST[&#39;id&#39;], &#34;int&#34;));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $Result = mysql_query($deleteSQL, $metrics) or die(mysql_error());<br />&#160;&#160;&#160; }<br />}</p>
<p>function GetSQLValueString($theValue, $theType, $theDefinedValue = &#34;&#34;, $theNotDefinedValue = &#34;&#34;)<br />{<br />&#160; $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;</p>
<p>&#160; switch ($theType) {<br />&#160;&#160;&#160; case &#34;text&#34;:<br />&#160;&#160;&#160;&#160;&#160; $theValue = ($theValue != &#34;&#34;) ? &#34;&#39;&#34; . $theValue . &#34;&#39;&#34; : &#34;NULL&#34;;<br />&#160;&#160;&#160;&#160;&#160; break;&#160;&#160; &#160;<br />&#160;&#160;&#160; case &#34;long&#34;:<br />&#160;&#160;&#160; case &#34;int&#34;:<br />&#160;&#160;&#160;&#160;&#160; $theValue = ($theValue != &#34;&#34;) ? intval($theValue) : &#34;NULL&#34;;<br />&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160; case &#34;double&#34;:<br />&#160;&#160;&#160;&#160;&#160; $theValue = ($theValue != &#34;&#34;) ? &#34;&#39;&#34; . doubleval($theValue) . &#34;&#39;&#34; : &#34;NULL&#34;;<br />&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160; case &#34;date&#34;:<br />&#160;&#160;&#160;&#160;&#160; $theValue = ($theValue != &#34;&#34;) ? &#34;&#39;&#34; . $theValue . &#34;&#39;&#34; : &#34;NULL&#34;;<br />&#160;&#160;&#160;&#160;&#160; break;<br />&#160;&#160;&#160; case &#34;defined&#34;:<br />&#160;&#160;&#160;&#160;&#160; $theValue = ($theValue != &#34;&#34;) ? $theDefinedValue : $theNotDefinedValue;<br />&#160;&#160;&#160;&#160;&#160; break;<br />&#160; }<br />&#160; return $theValue;<br />}<br />?&#62;</p>
</div>
]]></description>
        	        	<pubDate>Mon, 06 Dec 2010 22:10:26 +0200</pubDate>
        </item>
</channel>
</rss>