<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1039216" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1039216</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sql-update-query-correct#comment-1222620</link>
    <description> &lt;p&gt;Wow, that&#039;s some confusing code you&#039;ve got there! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&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;$con &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$server&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) or die(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Could not connect!\&quot;);&lt;br /&gt;mysql_select_db(\&quot;database_name\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$requestId&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = (int) &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;requestId&#039;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;UPDATE friends SET pending=&#039;y&#039; WHERE requestId=\&quot;. &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$requestId&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;if (mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sql&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp; echo \&quot;Friend request accepted!\&quot;;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp; die(\&quot;Friend request failed \&quot;. mysql_error());&lt;br /&gt;}&lt;br /&gt;mysql_close(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$con&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;If you don&#039;t want to get your site cracked, always &lt;a href=&quot;http://ca3.php.net/manual/en/language.types.type-juggling.php&quot; class=&quot;bb-url&quot;&gt;cast variables&lt;/a&gt; before putting them into a SQL query, secondly if you&#039;re putting a string into a query always run it through: &lt;a href=&quot;http://ca3.php.net/manual/en/function.mysql-escape-string.php&quot; class=&quot;bb-url&quot;&gt;mysql_escape_string&lt;/a&gt; first. Don&#039;t &lt;em&gt;ever&lt;/em&gt; trust any input from the user, assume that everyone who uses your site is out to get you: paranoid? Yes, but it works. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;*** EDIT ***&lt;br /&gt;
I changed your code to use PHP syntax highlighting, to do this on future posts enclose the code in: [ php ][ /php ]. Just makes it easier to read. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 03 Aug 2007 16:58:39 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1222620 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sql-update-query-correct#comment-1222619</link>
    <description> &lt;p&gt;Ok...&lt;/p&gt;
&lt;p&gt;This would be appropriate:&lt;br /&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;$sql &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;UPDATE friends SET pending = &#039;y&#039; WHERE userid = &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$userid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;..what is all the stuff afterwards?  Not only is it not making sense to me, but it seems to be wrong?  If you can explain what you are doing from &quot;VALUES&quot; on, then I can help you rewrite it.&lt;/p&gt;
 </description>
     <pubDate>Fri, 03 Aug 2007 16:53:52 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1222619 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
