Say I have a php file on my web server which contains a class 'Database'. Inside that class is a public function, lets call it 'data_select', which queries MySql database:
public function data_select($query) {
...
return $rows;
How would I pass in the '$query' parameter to this function from a Swift iOS application?
There are a number of answers online regarding $_POST from swift, but these often concern SQL queries such as 'INSERT INTO ...', whereas my case is a 'SELECT...' query. I also cannot seem to find anything regarding triggering class functions from Swift, although I know it must be possible.
Have I got the wrong idea here? I understand how to pull data from a php file on web server when the sql query and everything is included in the same file, but here the parameters of the query can differ, thus I have the basic SELECT query as part of a database class which can be called with different parameters on my test website, but I cannot work out how to pass in the query parameter from swift and trigger the function.
I guess I could trigger the functions by making a call to a different php file containing an instance of the function with the $query parameter passed in from swift. But would I then need to create multiple php files for each different 'SELECT...' query which sort of defeats the point of having the functions in a class???