> For the complete documentation index, see [llms.txt](https://learnhtml.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnhtml.gitbook.io/project/appml-php-ok.md).

# AppML PHP (ok)

https\://www\.w3schools.com/appml/appml\_php.asp

![](https://2287181742-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZhVmCGQ07Fy-3ttCbf%2F-MHajEDF9L7TzgDA_V_M%2F-MHbL7_5Vm10dlIBauVv%2FScreenshot_5.png?alt=media\&token=c30c1229-5a6f-48eb-9396-53e8cc22088a)

C:\xampp\htdocs\abc\customers.htm

```
<!DOCTYPE html>
<html lang="en">
<title>Customers</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<script src="https://www.w3schools.com/appml/2.0.3/appml.js"></script>
<body>
  <div class="w3-container" appml-data="appml.php?model=model_customers">
    <h1>Customers</h1>
    <table class="w3-table-all">
      <tr>
        <th>Customer</th>
        <th>City</th>
        <th>Country</th>
      </tr>
      <tr appml-repeat="records">
        <td>{{CompanyName}}</td>
        <td>{{City}}</td>
        <td>{{Country}}</td>
      </tr>
    </table>
  </div>
</body>
</html>
```

C:\xampp\htdocs\abc\create\_customers.htm

```
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<script src="https://www.w3schools.com/appml/2.0.3/appml.js"></script>
<script type="text/javascript" src="create_customers.js"></script>
<body>
  <div appml-data="appml.php?model=create_customers"></div>
</body>
</html>
```

C:\xampp\htdocs\abc\create\_customers.js

```
{
  "database": {
    "connection": "mydatabase",
    "execute": [
      "DROP TABLE IF EXISTS customers",
      "CREATE TABLE `appml`.`customers` ( `CustomerID` INT(10) NULL AUTO_INCREMENT , `CompanyName` VARCHAR(100) NOT NULL , `ContactName` VARCHAR(100) NOT NULL , `Address` VARCHAR(100) NOT NULL , `City` VARCHAR(100) NOT NULL , `PostalCode` VARCHAR(100) NOT NULL , `Country` VARCHAR(100) NOT NULL , PRIMARY KEY (`CustomerID`)) ENGINE = InnoDB",
      "INSERT INTO customers(CompanyName,ContactName,Address,City,PostalCode,Country) VALUES (\"Alfreds Futterkiste\",\"Maria Anders\",\"Obere Str. 57\",\"Berlin\",\"12209\",\"Germany\")",
      "INSERT INTO customers(CompanyName,ContactName,Address,City,PostalCode,Country) VALUES (\"Around the Horn\",\"Thomas Hardy\",\"120 Hanover Sq.\",\"London\",\"WA1 1DP\",\"UK\")",
      "INSERT INTO customers(CompanyName,ContactName,Address,City,PostalCode,Country) VALUES (\"Blauer See Delikatessen\",\"Hanna Moos\",\"Forsterstr. 57\",\"Mannheim\",\"68306\",\"Germany\")"
    ]
  }
}
```

C:\xampp\htdocs\abc\appml\_config.php

```
<?php echo ("Access Forbidden");exit(); ?>
{
	"dateformat" : "yyyy-mm-dd",
	"databases" : [{
    "connection" : "mydatabase",
    "host" : "localhost",
    "dbname" : "appml",
    "username" : "root",
    "password" : ""
	}]
}
```

C:\xampp\htdocs\abc\model\_customers.js

```
{
  "rowsperpage": 10,
  "database": {
    "connection": "mydatabase",
    "sql": "SELECT * FROM Customers"
  }
}
```

{% file src="/files/-MHbKykeay51ht-o0H37" %}
