I want to be able to format data from my website using a Go program. Right now my website is written in PHP and I am fetching data from an SQL table. My websites code is
<?php
include("connection.php");
$sql = mysqli_query($con, "SELECT * FROM talk");
while ($info = $sql->fetch_assoc()) {
echo "Name: " . $info['name'];
echo "<br>";
echo "Message: " . $info['message'];
echo "<br>";
}
And the page currently displays
Name: John
Message: My name is John
Name: Doe
Message: My name is Doe
I would like to be able to use a Go script to fetch the information of what the name and message is. I am open to changing the code for my website and I wrote it very simply to be able to give a brief understanding of what I am trying to do.