the function must have a filename, you're best bet is to grep for the file or use regular expressions and then place it in fopen(). fopen opens any file, including database files, however, it always opens them like your favorite text editor. you won't be able to send SQL statements or anything like that, and like most true databases if you open the data files, you'll be reading a whole lot of junk.