Display SQL in html, y html in SQL (forms)

<?php

global $wpdb;
$result = $wpdb->get_results( "SELECT  ID_Rider_Name, Horse_Name, Position, Score  FROM zapateri_xxy0lpig.Competiton_results");

echo "<style>";
echo "body {font-family: Arial;}";

echo ".table_container { padding: 10px 12px 0px 12px;  border: 1px solid #ccc;  }";
echo ".table_container th { background-color:black; color:orange; font-weight:bold; border-left: 1px solid white;}";
echo "</style></head>";
echo "<body>";

echo "<div class=\"table_container\"><table>";
echo "<tr><th style=\"padding-left:10px;\">Rider Name</th><th>Horse Name</th><th>Position</th><th>Score</th></tr>";
echo '<p>Hello World</p>';
foreach ($result as $row) {
	echo "<tr><td>" . $row->ID_Rider_Name . "</td><td>" . $row->Horse_Name . "</td><td>" . $row->Position . "</td><td>" . $row->Score . "</td></tr>";
}
echo "</table></div>";

?>

crear formularios y guardar datos en sql