AppML动态数据库连接

I am new to web development. I am currently studying many web programming languages (client and server side).

I am trying to build a web app that connects to many different databases and many different tables in these database depending on the user input.

Currently I am using the following: 1. html (for user view) 2. php (for controller functions) 3. mysql (my data source) 4. appml (for easy data extraction and display) 5. json (for modeling my data)

I have been able to create a php/html page that connects via appML to my MySQL database and to a table inside it.

Here is my calling page code Reports.php:

<?php

?>
<!DOCTYPE html>
<html lang="en">
<title>Customers</title>
<script src="appml.js"></script>
<body>
<div class="container" appml-data="appml.php?model=model_Report.js">
<h1>Interfaces</h1>
<table class="table table-striped table-bordered">
<tr>
<th>Description</th>
<th>Location</th>
<th>Model</th>
<th>Serial Number</th>
<th>IP Address</th>
<th>Subnet/Gateway</th>
<th>Firmware Version</th>
</tr>
<tr appml-repeat="records">
<th>{{description}}</th>
<th>{{location}}</th>
<th>{{model}}</th>
<th>{{serial_number}}</th>
<th>{{ip_address}}</th>
<th>{{subnet_gateway}}</th>
<th>{{firmware_version}}</th>
</tr>
</table>
</div>

</body>
</html>

Here is my model_Reports.js code for the Reports.php page:

{
"rowsperpage" : 28,
"database" : 
  {
    "connection" : "myDB1",
    "sql" : "SELECT * FROM **network**",
    "orderby" : "id"
  }
}

Here is my appml_config.php code for appml.php running on server:

<?php echo("Access Forbidden");exit();
?>
{
"dateformat" : "yyyy-mm-dd",
"databases" : [
{
    "connection" : "myDB1",
    "host" : "localhost",
    "dbname" : "**aDataBase**",
    "username" : "random",
    "password" : "pass" 
}
]
}

Now, I want to move to the next step, allowing the user to choose: 1. which db to connect to 2. which table to connect to 3. which queries to run

The text I created in bold are the items I have identified that are to be dynamic. The user should choose.

I have tried searching the web, replacing them with relevant PHP variables using the echo command. But to no avail.

Can anyone give me a pointer or two on how this can be achieved. I am not looking that someone do the code for me, just to tell me what strategy and languages I am looking at that will provide the solution after more research and coding from my side.

Thanks.