I have a subdomain I'd like to only be accessible by a local IP address.  Is it possible to specify this in the vhost?  I'm thinking it's not since I haven't found much on Google.  If not, what's the best way to do this on an apache level?  I forget the version of Linux we're using... but we have Samba running on it.

The site I'm trying to restrict is our site's documentation.


Question: Populate column with number of substrings in another column
Answer: You want an update query:

update A
    set cnt = (select sum((length(a.body) - length(replace(a.body, b.value, '')) / length(b.value))
               from b
              )


This uses a little trick for counting the number of occurrence of b.value in a given string.  It replaces each occurrence with an empty string and counts the difference in length of the strings.  This is divided by the length of the string being replaced.

If you just wanted the number of matches (so the first value would be "2" instead of "3"):

update A
    set cnt = (select count(*)
               from b
               where a.body like concat('%', b.value, '%')
              )