MySQL db access using PHP and JSON