title: retrieving Illegal string offset id
body: <p>have a problem retrieving  Illegal string offset 'id' in C:\xampp\htdocs\admin\gestione_articoli_slider.php and the same for 'titolo'</p>
  
  <p>I wanna have a form to upload images udating mysql row sending to upload_image3.php the id of the row i wanna update. So my goal is retrieving all title from my articles and showing them in the option value of my form. Connection is ok by data2->connetti();</p>
  
  <p>Which is the problem with the offset? if a echo $row_titoli['title'] i get the correct output.</p>
  
  <p>Thanks for help, here is my code:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" action="upload_image3.php" method="post"&gt;
      &lt;i&gt;Immagine:&lt;/i&gt; 
      &lt;input name="form_img" type="file" /&gt;&lt;br /&gt;
      &lt;select name="id"&gt;
          &lt;?php 
          include "include/connection2.php";
          $data2 = new MysqlClass();
          $data2-&gt;connetti();
  
          $titoli = mysql_query("SELECT * FROM articoli");
          $row_titoli = mysql_fetch_array($titoli);
  
          foreach($row_titoli as $titole){ ?&gt;
              &lt;option value="&lt;?php echo $titole['id']; ?&gt;"&gt;
              &lt;?php echo $titole['titolo']; ?&gt; &lt;/option&gt;
  
          &lt;?php } ?&gt;
      &lt;/select&gt;
      &lt;input type="submit" value="Upload" /&gt;
  &lt;/form&gt;
  </code></pre>