title: Using the $wpdb in wordpress to run SQL commands
body: <p>I created a simple update command to update a database entry. I want to be able to run any sql statement and update my wordpress database:</p>
  
  <pre><code>&lt;?php    
  global $wpdb;
  $sql = "UPDATE tablename SET column1='testdata' WHERE id=1";
  $results = get_results($sql); ?&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$results = query($sql);
  </code></pre>
  
  <p>No matter what I do I get the error:</p>
  
  <p>Fatal error: Call to a member function get_results() on null in C:\MAMP\htdocs\new\samplesql.php on line 4</p>