title: I am trying to do an ASP like repeater in PHP
body: <pre><code>&lt;?php
  $dbhost = 'xxxx';
  $dbuser = 'xxxx';
  $dbpass = 'xxxx';
  $dbname = 'xxxx';
  
  $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
  
  mysql_select_db($dbname);
  $result = mysql_query("SELECT * FROM mytable");
  
  $row = mysql_fetch_array($result)
  ?&gt;
  &lt;?php foreach ($rows as $row): ?&gt;
    &lt;tr align="center"&gt;
            &lt;td&gt;&lt;?php echo htmlspecialchars($row['Picturedata']); ?&gt;&lt;/td&gt;
            &lt;/tr&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>I get an error:
  Warning: Invalid argument supplied for foreach()</p>