title: RMySQL retrieving data from database table basing on an if statement
body: <p>I am trying to retrieve data from a database table based on a given condition:</p>
  
  <p>I want to select all from a table, and during the while loop I put a condition like to return only what I want the way it is done in PHP</p>
  
  <pre><code>mytable &lt;- dbSendQuery(con, "select date from member")
  
  while(!dbHasCompleted(mytable)){
     if(name = 'myname'){
  
    new_date &lt;- dbFetch(mytable, n=-1)
    print(mytable)
  
    }
  }
  </code></pre>
  
  <p>How do I deal with the if statements to operate well?</p>