title: How can I fix "PHP Warning: Variable passed to each() is not an array or object"?
body: <p>I am using <a href="http://sourceforge.net/projects/phpinv/?source=dlp" rel="nofollow">phpInv</a></p>
  
  <p>on <a href="http://alex.piechowski.org/inventory" rel="nofollow">http://alex.piechowski.org/inventory</a>. login=admin/phpinv</p>
  
  <p>I keep getting "PHP Warning: Variable passed to each() is not an array or object"</p>
  
  <p>on line 38 of entry_new.php</p>
  
  <pre><code>if ($itemid&gt;0) {
              --&gt; while (list ($colid, $property) = each ($col)) { &lt;--
                      $result = $DB-&gt;query("INSERT INTO ".$DB-&gt;tableprefix."property (itemid,colid,property) VALUES ('".str_prepare($itemid)."','".str_prepare($colid)."','".str_prepare($property)."')");
                      if (!$result) {
                          $errortext = "Error: property not created\n";
                          eval("\$table = \"".templateget('error')."\";");
                      }
                  }
  </code></pre>
  
  <p>Would anybody please be willing to D/L and help me out? I've been working hours on this and I can't seem to get it to work...</p>
  
  <p>It's receiving a posted array.</p>