bmish/GuessThatFriend — comment on commit e571df0c8cd6ecd8bf46b8dd80cda056c592eea4
File: api/classes/Category.php line 24
By bmish:

It isn't necessary to connect to the database here. The top level file api/index.php will open the connection when the user visits a page, call your code if necessary, and then close the connection when everything is done. All of these functions should assume the database is already taken care of.