title: CHECKING if a value exists in a table SQL
body: <p>I am making a bot where I need to store the <code>commandname</code> and <code>commandreply</code> in the database. I am using mySQL Workbench. </p>
  
  <p>I want to check if the <code>commandname</code> that the user tries to make is already in the table, and if so display that. If not, then carry on (make the command).</p>
  
  <pre><code>connection.query("SELECT commandname FROM commands WHERE EXISTS (commandname = " + args[0] + ")" 
  </code></pre>
  
  <p>(Where <code>args[0]</code> is the command name). This is what I initially thought, although I don't have much experience in SQL. I'm not sure what this would display if it exists, or if it doesn't exist.</p>