title: Alternatives for mysql data retrieval
body: <p>Is there an alternative way to do this:</p>
  
  <pre><code>$resulter=mysql_query("SELECT * FROM mail WHERE status='UNREAD'");
  $a=0;
  $name=$selfinfo["username"];
  while($result=mysql_fetch_assoc($resulter)){
  Foreach($result as $aaa){
  if($aaa["msgto"]==$name){
  $a=$a+1;
  }}}
  echo("&lt;br&gt;$a Unread messages");
  </code></pre>
  
  <p>I keep ending up with this error:</p>
  
  <pre><code>Warning: Illegal string offset 'msgto' in /home/u534673521/public_html/test/loginsystem/members.area.php on line 18
  </code></pre>
  
  <p>And i have no idea whats wrong.</p>