getting MySQL result as an object inside index.php