title: Access MYSQL from .htaccess
body: <p>I am trying to block access to my site from htaccess level. I am looking to read bad IP's from a MySQL table then limit access using that.</p>
  
  <ol>
  <li><p>Is this a safe method to use?</p></li>
  <li><p>How do I create a connection from htaceess?</p></li>
  </ol>
  
  <p>I have checked previous similar question but non have the actual connection code</p>
  
  <p>Thanks</p>