<?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: "Could not update" error when updating info in database</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/could-not-update-error-when-updating-info-in-database</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/could-not-update-error-when-updating-info-in-database/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>rob-t on "Could not update" error when updating info in database</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/could-not-update-error-when-updating-info-in-database#p21578</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/could-not-update-error-when-updating-info-in-database#p21578</guid>
        	        	<description><![CDATA[</p>
<p>Hi there.&#160; Thanks for jqgrid, it&#39;s great!&#160; I am very new at php, sql, and java, so please bear with me.</p>
<p>I am using jqGrid for PHP v3.8 (<a rel="nofollow" href="http://www.trirand.net/download.aspx" target="_blank">http://www.trirand.net/download.aspx</a>).</p>
<p>UPDATE: I got it working, at least for one table.&#160; My problem was that I never defined a key in my grid.php.</p>
</p>
<p>I had to add this info (based on the demos):</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8758' value='Select Code' data-codeid='sfcode8758' /></p>
<div class='sfcode' id='sfcode8758'>
<div class=&#34;sfcode&#34;>//&#160;Set&#160;the&#160;table&#160;to&#160;where&#160;you&#160;add&#160;the&#160;data <br />$grid-&#62;table&#160;=&#160;&#39;customers&#39;; <br />$grid-&#62;setPrimaryKeyId(&#39;CustomerID&#39;); <br />$grid-&#62;serialKey&#160;=&#160;false;</div>
<p><input type='button' class='sfcodeselect' name='sfselectit4604' value='Select Code' data-codeid='sfcode4604' /></p>
<div class='sfcode' id='sfcode4604'>//&#160;The&#160;primary&#160;key&#160;should&#160;be&#160;entered <br />$grid-&#62;setColProperty(&#39;CustomerID&#39;,&#160;array(&#34;editrules&#34;=&#62;array(&#34;required&#34;=&#62;true)));</div>
</p>
</div>
<p><strong>So does anyone know how I can set this up to pull data from more than one database table and then save it to the appropriate table so that it can all be edited on one grid?</strong></p>
</p>
<p>For example, my select command uses data from 3 tables:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit837' value='Select Code' data-codeid='sfcode837' /></p>
<div class='sfcode' id='sfcode837'>$grid-&#62;SelectCommand = &#39;SELECT a.uid, a.name, b.firm, b.city, b.state, a.mail, b.paidmembershipdate, b.firmcategoryone FROM users a, profile b, node c WHERE a.uid=c.uid AND c.nid=b.nid&#39;;</div></p>
]]></description>
        	        	<pubDate>Fri, 07 Jan 2011 22:55:59 +0200</pubDate>
        </item>
</channel>
</rss>