从外部php文件添加html文件中的行

I'm trying to find how to insert a row line to a table in html so , but i would like to do it using an external php file, but maybe another solution because the purpose is to get a table from a database one and write it down to an html table.

i've tried to look on the internet but i didn't find something that was fitting with what i was lookin for.

Do you mean some thing like "example 1" from here (https://www.php.net/manual/en/mysqli-result.fetch-assoc.php)?

You only need to add the html tags to create the html table (table, td, ...).

EDIT:

This example includes the html tags and should do what you want:

<html>
...
<body>
<?php

   $mysqli = new mysqli("localhost", "my_user", "my_password", "database");

   $query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";

   if ($result = $mysqli->query($query)) {

       echo "<table>";
       /* fetch associative array */
       while ($row = $result->fetch_assoc()) {
           echo "<tr><td>" . $row['Name'] . "</td><td>" . $row['CountryCode'] . "</td></tr>";
       }
       echo "</table>";

       /* free result set */
       $result->free();
   }
?>
</body>