<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1016462" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1016462</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/few-difficult-me-least-php-questions#comment-1095502</link>
    <description> &lt;p&gt;Hi Mark&lt;/p&gt;
&lt;p&gt;I wasn&#039;t claiming that all variables weren&#039;t variants, what I was saying was that he hadn&#039;t of defined what kind of data strcuture &#039;s&#039; is. Is it a scalar, array, hash, syscall etc.&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Dec 2001 18:27:00 +0000</pubDate>
 <dc:creator>Wil</dc:creator>
 <guid isPermaLink="false">comment 1095502 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/few-difficult-me-least-php-questions#comment-1095491</link>
    <description> &lt;p&gt;By default, all variables are variant.  You can, however, type cast them.  But you&#039;ll rarely ever see anyone do that in PHP.  Examples:&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;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// make a dummy var&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;1234\&quot;;&lt;br /&gt;&lt;br /&gt;// let&#039;s type cast&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myString&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = (string) &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&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;$myInt&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = (int) &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&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;$myBool&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = (bool) &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;// let&#039;s settype()&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myString&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = settype(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, \&quot;string\&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myInt&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = settype(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, \&quot;int\&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myBool&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = settype(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tmp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, \&quot;bool\&quot;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
PHP Docs: &lt;a href=&quot;http://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting&quot; class=&quot;bb-url&quot;&gt;type-casting&lt;/a&gt;, &lt;a href=&quot;http://www.php.net/manual/en/language.types.type-juggling.php&quot; class=&quot;bb-url&quot;&gt;type-juggling&lt;/a&gt;, &lt;a href=&quot;http://www.php.net/manual/en/function.settype.php&quot; class=&quot;bb-url&quot;&gt;settype()&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Dec 2001 17:11:04 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1095491 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/few-difficult-me-least-php-questions#comment-1095485</link>
    <description> &lt;p&gt;A lot more of your script would be very useful in helping you with your problems.&lt;/p&gt;
&lt;p&gt;You know this variable you are trying to define? Does the variable get defined from a database? A much better way to write that would be:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if (!$s) &lt;br /&gt;{&lt;br /&gt; $s = 1;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
Please note that I come from a Perl background and not a PHP one, although both language do share common properties. &lt;/p&gt;
&lt;p&gt;Surely you have to state what kind of data structure &#039;s&#039; is? Is it a scalar, array, hash, monkey, elephant? &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;For your second question, hmm. I think I&#039;ll need more information again. How are you preparing and executing this? A few notes, however, the line:&lt;/p&gt;
&lt;p&gt;&quot;$sql = &quot;UPDATE TABLE products SET&quot; &lt;/p&gt;
&lt;p&gt;should be replaced with:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$sql = &amp;quot;UPDATE products SET &lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
You don&#039;t need TABLE there. In fact, that could actually be your error.&lt;/p&gt;
&lt;p&gt;Put your last statement on a seperate line. It looks cleaner, and you can also enclose that with single quotation marks too.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;...&lt;br /&gt;WHERE&lt;br /&gt;Product_ID = &amp;#039;$id&amp;#039;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Dec 2001 15:21:24 +0000</pubDate>
 <dc:creator>Wil</dc:creator>
 <guid isPermaLink="false">comment 1095485 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
