<?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: Beginner: Saving data to MySQL</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/beginner-saving-data-to-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/beginner-saving-data-to-mysql/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>dberard on Beginner: Saving data to MySQL</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beginner-saving-data-to-mysql#p23722</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beginner-saving-data-to-mysql#p23722</guid>
        	        	<description><![CDATA[<p>I am using the following pages to edit/delete inline (see below). I hope it helps.</p>
<p>sales.php</p>
<p>&#60;script type="text/javascript"&#62;<br />$(function(){ <br />&#160; $("#grps").jqGrid({<br />&#160;&#160;&#160; url:&#39;dbConfig.php&#39;,<br />&#160;&#160;&#160; datatype: &#39;xml&#39;,<br />&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160; colNames:[&#39;&#39;,&#39;Sales Rep&#39;,&#39;Bill to Code&#39;, &#39;Activity Date&#39;,&#39;Customer&#39;,&#39;RFSI&#39;,&#39;EFMS&#39;,&#39;FLT&#39;,&#39;MX&#39;,&#39;Growth Plan&#39;],<br />&#160;&#160;&#160; colModel :[<br />&#160;&#160; &#160;{name: &#39;myac&#39;, width:80, fixed:true, sortable:false, resize:false, formatter:&#39;actions&#39;, formatoptions:{keys:true}}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;repName&#39;, index:&#39;repName&#39;, sortable:true, width:110, editable:true, search:true,stype:&#39;text&#39;}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;code&#39;, index:&#39;code&#39;, width:100, sortable:true, align:&#39;center&#39;, editable:true, search:true,stype:&#39;text&#39;}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;salesDate&#39;, index:&#39;salesDate&#39;, width:100, sortable:true,align:&#39;center&#39;, editable:true}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;customer&#39;, index:&#39;customer&#39;, width:200, align:&#39;left&#39;, editable:true, search:true,stype:&#39;text&#39;}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;RFSI&#39;, index:&#39;RFSI&#39;, width:50, sortable:true,align:&#39;center&#39;, editable:true,edittype:"checkbox",editoptions: {value:"X"}},<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;EFMS&#39;, index:&#39;EFMS&#39;, width:60, sortable:true,align:&#39;center&#39;, editable:true,edittype:"checkbox",editoptions: {value:"X"}},<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;FLT&#39;, index:&#39;FLT&#39;, width:50, sortable:true,align:&#39;center&#39;, editable:true,edittype:"checkbox",editoptions: {value:"X"}},<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;MX&#39;, index:&#39;MX&#39;, width:50, sortable:true,align:&#39;center&#39;, editable:true,edittype:"checkbox",editoptions: {value:"X"}},<br />&#160;&#160; &#160;&#160; {name:&#39;comment&#39;, index:&#39;comment&#39;, width:450, sortable:false, editable:true,edittype:"textarea", editoptions:{rows:"3",cols:"50"}}<br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; pager: &#39;#pgrps&#39;,<br />&#160;&#160;&#160; rowNum:15,<br />&#160;&#160;&#160; rowList:[10,25,50,100],<br />&#160;&#160; &#160;autowidth: true,<br />&#160;&#160;&#160; sortname: &#39;id&#39;,<br />&#160;&#160;&#160; sortorder: &#39;desc&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160; &#160;width: "98%", <br />&#160;&#160; &#160;height: "100%",<br />&#160;&#160; &#160;editurl: "includes/inlineEdit.php",<br />&#160;&#160;&#160; caption: &#39;Action Plan List&#39;<br />&#160; });<br />&#160; <br />&#160; ///////// Nav buttons /////////////////<br />jQuery("#grps").jqGrid(&#39;navGrid&#39;,&#39;#pgrps&#39;,{edit:false,add:false,del:false,search:true,refresh:true},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {},{},{},{multipleSearch:true});<br />}); <br />&#60;/script&#62;</p>
</p>
<p>&#60;table id="grps"&#62;&#60;/table&#62; <br />&#160; &#60;div id="pgrps"&#62;&#60;/div&#62;</p>
</p>
<p>editInline.php (short version)</p>
<p>/////// DELETE RECORD ////////////////////</p>
<p>if (($_POST[&#39;oper&#39;]) == "del") {<br />&#160;&#160; &#160;<br />&#160; $deleteSQL = sprintf("DELETE FROM sales_call WHERE id=%s",<br />&#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;], "int"));</p>
<p>&#160; mysql_select_db($database_intranet, $intranet);<br />&#160; $Result1 = mysql_query($deleteSQL, $intranet) or die(mysql_error());<br />}</p>
<p>/////// UPDATE RECORD ////////////////////</p>
<p>if (($_POST[&#39;oper&#39;]) == "edit") {<br />&#160; $updateSQL = sprintf("UPDATE sales_call SET repName=%s, code=%s, salesDate=%s, customer=%s, RFSI=%s, EFMS=%s, FLT=%s, MX=%s, comment=%s WHERE id=%s",<br />&#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;repName&#39;], "text"),<br />&#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;code&#39;], "text"),<br />&#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;salesDate&#39;], "date"),<br />&#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;customer&#39;], "text"),<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; GetSQLValueString($_POST[&#39;RFSI&#39;], "text"),<br />&#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;EFMS&#39;], "text"),<br />&#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;FLT&#39;], "text"),<br />&#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;MX&#39;], "text"),<br />&#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;comment&#39;], "text"),<br />&#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;], "int"));</p>
<p>&#160; mysql_select_db($database_intranet, $intranet);<br />&#160; $Result1 = mysql_query($updateSQL, $intranet) or die(mysql_error());<br />}<br />&#160; ?&#62;</p>
]]></description>
        	        	<pubDate>Wed, 22 Jun 2011 00:10:01 +0300</pubDate>
        </item>
        <item>
        	<title>Donaldini on Beginner: Saving data to MySQL</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beginner-saving-data-to-mysql#p23509</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beginner-saving-data-to-mysql#p23509</guid>
        	        	<description><![CDATA[<p>Hey,&#160;</p>
</p>
<p>I feel like such a noob for asking this, but I cannot seem to figure out how to save my edited row to my MySQL database.</p>
<p>Because I didn&#39;t want to clog this screen with code i&#39;ve put up my code on pastebin.</p>
<p><a href="http://pastebin.com/6nfrVr8z" target="_blank">Index.html</a>&#160;&#124; <a href="http://pastebin.com/62tMzX1H" target="_blank">example.php</a> &#124; <a href="http://pastebin.com/DSB3MPJH" target="_blank">edit.php</a></p>
</p>
<p>Can anyone tell me what i&#39;m doing wrong or forgetting? I already googled and checked out the wiki and examples but couldn&#39;t find a clear answer about what to do.</p>
<p>I hope my code is clear to read, if something is unclear, i&#39;ll be glad to help out.</p>
]]></description>
        	        	<pubDate>Tue, 07 Jun 2011 13:01:09 +0300</pubDate>
        </item>
</channel>
</rss>