Good evening,
I need a little help.
After having extracted the data from a database table, I would need to print them on the screen in a certain part of an html page with 3 frames (exactly in section B of the "test" page as shown in the example)
esempio1.png

What should I insert in this php code?

<?php
// dati di connessione al mio database MySQL
$db_host = 'localhost';
$db_user = 'xx';
$db_pass = 'xx';
$db_name = 'xx';
// connessione al DB utilizzando MySQLi
$cn = new mysqli($db_host, $db_user, $db_pass, $db_name);
// verifica su eventuali errori di connessione
if ($cn->connect_errno) {
    echo "Connessione fallita: ". $cn->connect_error . ".";
    exit();
}
$query="SELECT * FROM news ORDER BY email DESC";
$oggetto =$cn->query($query);
echo "<table><tr>";
echo "<th>--------Nuove iscrizioni--------</th>";
echo "</tr>";
while($scorri_oggetto=$oggetto->fetch_assoc()){
?>
<tr>
<th><?php printf($scorri_oggetto['email']);?></th>
</tr>
<?php
}
echo "</table>";
// chiusura della connessione
$cn->close();    ?>

Thank you all

I see tr (table row), th, (table header) but no td (table data.)

Also in your graphic example of items a, b and c, it's unclear what is data, what is the header. But since you only used th (table header) I suspect the result to be one row which is that header. I could be wrong but let's get you a tutorial with tr, th and td.
https://www.w3schools.com/html/html_tables.asp

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.