title: How to check if row exists using sqlx?
body: <p>Using <a href="https://github.com/jmoiron/sqlx" rel="nofollow noreferrer">sqlx</a>, I'd like to know query MySql database to know whether a query on MySql returns empty rows:</p>
  
  <p>So following <a href="https://github.com/jmoiron/sqlx/issues/375" rel="nofollow noreferrer">this</a>, I came up with</p>
  
  <pre><code>var result model.Post
  err := database.SQL.Get(&amp;result, "SELECT * FROM post WHERE post_id=? AND user_id=? LIMIT 1", postID, userID)
  if err == sql.ErrNoRows { 
      log.Println(err)
      log.Println("post not found")
  } else { 
      log.Println("post found")
  }
  </code></pre>
  
  <p>But I always get <code>post found</code>, despite the fact that there is no row. </p>
  
  <p>What could be wrong here and how can I fix it?</p>