added tables for categories; fixed bug in open_database() PHP lib