title: Check if IP is in CIDR netmask (range)
body: <p>I have 2 tables <code>ip</code> and <code>cidr</code>. </p>
  
  <p>In the first one I store IP's. (2 column table, id, ip), here is an example (the values are fictional): </p>
  
  <pre><code>id | ip
  ---+-------------
   1 | 172.922.2.10
  ---+-------------
   2 | 194.22.10.13
  </code></pre>
  
  <p>In the second one I store CIDR netmask's (2 column table, id, cidr), here is an example (the values are fictional): </p>
  
  <pre><code>id | cidr
  ---+-------------
   1 | 26.232.49.0/20
  ---+---------------
   2 | 14.44.182.0/24
  </code></pre>
  
  <p>Is there any way to make a mysql query to check whether the ip's from the first table are in the range of any of my cidr netmasks?</p>
  
  <p>Note: To convert a cidr netmask to a range of ip's click <a href="http://magic-cookie.co.uk/iplist.html" rel="nofollow">here</a></p>