For create mysql view run this query.
* From civicrm_contact table we will fetch id and first name
CREATE VIEW civiContacts AS SELECT id, first_name FROM civicrm_contact
For call view in php
JSON is lightweight text-data interchange format
JSON is language independent *
JSON is "self-describing" and easy to understand
* Connection Class(Connection.class.php)