<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1053052" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1053052</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Some notes to begin</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/editing-sql-data-php#comment-1273683</link>
    <description> &lt;p&gt;Some notes to begin with:&lt;/p&gt;
&lt;p&gt;Your site is very insecure and open to hacks. Look into using the &lt;strong&gt;mysql_real_escape_string &lt;/strong&gt; (&lt;a href=&quot;http://php.net/mysql_real_escape_string&quot; title=&quot;http://php.net/mysql_real_escape_string&quot;&gt;http://php.net/mysql_real_escape_string&lt;/a&gt; for explanation and examples)&lt;/p&gt;
&lt;p&gt;Also, why you should aways wrap data with mysql_real_escape_string for use in queries, for display on a web page (and this include the value=&quot;whatever&quot; for inputs), you should always use &lt;strong&gt;htmlspecialchars($myVar,ENT_QUOTES)&lt;/strong&gt;. Lastly, when you go to use a piece of data in a URL, use &lt;strong&gt;urlencode() &lt;/strong&gt; (these last two you can get to them by adding &lt;a href=&quot;http://php.net/&quot; title=&quot;http://php.net/&quot;&gt;http://php.net/&lt;/a&gt; in front like the first one I gave you)&lt;/p&gt;
&lt;p&gt;For these I refer to any data that can be changed by the end user, which includes, but isn&#039;t limited to, the following:&lt;br /&gt;
$_POST, $_GET, $_COOKIE, $_SERVER[&#039;HTTP_REFERRER&#039;], $_SERVER[&#039;HTTP_USER_AGENT&#039;] $_SERVER[&#039;PHP_SELF&#039;], $_SERVER[&#039;QUERY_STRING&#039;]  also any data that may have came from these sources (is once came from here and was put into database and read back in)&lt;/p&gt;
&lt;p&gt;I edited your post to remove your login information, hopefully it is locked down so it will not et remote users in, but since you have published the information on a high traffic forum, you will probably want to go change the password ASAP. &lt;/p&gt;
&lt;p&gt;So, now back to you issue.. You didn&#039;t list which one is givng you the error, but anytime you get an error, it is a good idea to echo out the actual $SQL query so you can see what variable replacement was done, sometimes when you do this you can catch a misplaced quote. &lt;/p&gt;
&lt;p&gt;If you can&#039;t see it from there, try manually running the SQL directly on the server (worse case, use phpMyAdmin to manually execute it), sometimes it will give you more details of what exactly is wrong. But in this case (based on what you posted) it is running into a doublequote somewhere it wasn&#039;t expected, and since the code at quick glance looks good, must be coming from a variable somewhere (again, where mysql_real_escape_string would help, and echoing it out you would probably see where it is.&lt;/p&gt;
&lt;p&gt;Here is an example of some code to use:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;define &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;DEBUG_MODE&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// change to false when done testing&lt;br /&gt;&lt;br /&gt;// Connect to database&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$SQL &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;SELECT `field1`, `field2` FROM `tblCars` WHERE `field3` = &quot;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_real_escape_string&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myVariable&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&quot; ORDER BY `lastfield`&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rsCars &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$SQL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) &lt;br /&gt;&amp;nbsp;&amp;nbsp; or die (&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;[ERR-&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;__LINE__&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;] &#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.((&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;DEBUG_MODE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) ? &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_error&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;br /&amp;gt;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$SQL &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;There was an error with a database query&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_num_rows&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rsCars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) &amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aryRow &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_fetch_assoc&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rsCars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Field1 = &#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aryRow&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field1&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]),&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;br /&amp;gt;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Field2 = &#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;htmlspecialchars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aryRow&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field2&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]),&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;br /&amp;gt;\n&amp;lt;br /&amp;gt;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_free_result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rsCars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;There were no records found...&amp;lt;br /&amp;gt;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;unset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rsCars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You will notice in the first line, there is a constant that you set to TRUE or FALSE to display more error information. it is good practice that when a script goes &quot;live&quot; (intended for others to access it) you do not list mysql errors, as there could be times depending on the query, it could give out info to help a someone compromise your site. While you are working on it (and after it goes live, if you come across an error), you can set this back to TRUE to see more info.&lt;/p&gt;
&lt;p&gt;Good luck with this.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Thu, 08 Mar 2012 01:02:20 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1273683 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>First test this code on local</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/editing-sql-data-php#comment-1273679</link>
    <description> &lt;p&gt;First test this code on local host then see if you get the same error.&lt;/p&gt;
 </description>
     <pubDate>Wed, 07 Mar 2012 12:47:22 +0000</pubDate>
 <dc:creator>vasvigupt</dc:creator>
 <guid isPermaLink="false">comment 1273679 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
