progetto201 API
|
COLUMNNAMES: manages columns' names. More...
Functions | |
getColumNames ($t_conn_res) | |
Returns the name of the colums in a data table. More... | |
Variables | |
$response = array("errors" => array()) | |
Prepare default response array with no errors. More... | |
$nodetypes = array("0" => "t_type0_data") | |
COLUMNNAMES: manages columns' names.
Client perspective:
This script sets the returned content type to JSON, includes the db_connection.php script
It is used to connect to MySQL and execute basic SELECT queries
and then defines the response array.
One function is defined:
getColumNames()
Returns the name of the colums in a data table.
If the script isn't included it tries to connect to the database, and checks the request method:
When the called function ends the connection to the DB gets terminated, and data (or errors) is collected inside the response array. The response array gets echoed to the client in JSON format
Errors list:
getColumNames | ( | $t_conn_res | ) |
Returns the name of the colums in a data table.
First it checks that typeid is set both in the request and in the $nodetypes array, then a SELECT query is executed to retrieve the column names.
array | $t_conn_res | array with the DB connection object |
$nodetypes = array("0" => "t_type0_data") |
$response = array("errors" => array()) |
Prepare default response array with no errors.