Move MySQL Queries to function, add articles SQL