<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1041909" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1041909</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Curse you for being faster</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/checking-its-number-enough#comment-1233388</link>
    <description> &lt;p&gt;Curse you for being faster than me pr0gr4mm3r, you said exactly what I was going to. &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;Personally I love how &lt;a href=&quot;http://api.drupal.org/api/function/db_query/6&quot;&gt;Drupal does data sanitation&lt;/a&gt;, in a &lt;code&gt;printf&lt;/code&gt; style. For example, to get Andy&#039;s user account we might run:&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;$result &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;db_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM users WHERE username=&#039;%s&#039; AND number_of_posts &amp;gt; %d&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;andy206uk&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1000&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;Sanitation is part of the &lt;code&gt;db_query()&lt;/code&gt; function, so you never have to worry about it. I advise you to borrow from this and create your own similar functions. &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;
 </description>
     <pubDate>Fri, 12 Sep 2008 20:15:00 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1233388 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Another note, it also works</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/checking-its-number-enough#comment-1233385</link>
    <description> &lt;p&gt;Another note, it also works for numeric strings as well&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;$var &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//is_numeric() returns true&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//is_numeric() returns true&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;
 </description>
     <pubDate>Fri, 12 Sep 2008 16:03:26 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1233385 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Wow - quick response!
I&#039;m</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/checking-its-number-enough#comment-1233382</link>
    <description> &lt;p&gt;Wow - quick response!&lt;/p&gt;
&lt;p&gt;I&#039;m not familiar with type casting in PHP, but I&#039;m definitely going to read up on it now!&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Sep 2008 15:05:27 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1233382 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Yup, I will often type cast</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/checking-its-number-enough#comment-1233381</link>
    <description> &lt;p&gt;Yup, I will often type cast it to an integer instead of escaping it if I know it should be a number.  Don&#039;t know if that saves CPU time or not, but it further cleans that piece of data.&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;$some_number &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= (int)&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$some_number&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;
 </description>
     <pubDate>Fri, 12 Sep 2008 14:58:15 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1233381 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
