title: return values from class php oop
body: <p>the code is as follow: </p>
  
  <pre><code>Class userinfo {
      function fetchdatabyemail($email) {
          $result=mysql_query(" SELECT * FROM users WHERE email='$email'"); 
          while($row = mysql_fetch_array($result)) {
              $name = $row['name'];
              $num = $row['num'];
              $city = $row['city'];
          }
          $numrows= mysql_num_rows($result);    
      }
  }
  </code></pre>
  
  <p>now to get the info I do this :</p>
  
  <pre><code>$info = new userinfo();
  $info-&gt;fetchdatabyemail('email@email.com');  
  echo $info-&gt;city; 
  </code></pre>
  
  <p>and it doesnt return the info. I think Im doing something wrong any ideas please </p>