I have a chat bot that creates a corpus of messages from a GroupMe chat and generates responses using the Markovify module in Python 3. I recently started running a LAMP stack out of my dorm so that I can record these messages, store them in a MySql database, and display them on demand for people on the University wifi.
My problem as of late is that question and quotation marks, which show up fine in the python console program, appear as "�" on the web page. Here's the index.php file:
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
<title> Hove and Lonor Database </title>
</head>
<body>
<div id="top_container">
<h1 class="title">HOVE AND LONOR LIVE FEED Y'ALL</h1>
<h2><a href="/search/"> user lookup </a></h2>
</div>
<center>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$conn = mysqli_connect('localhost', 'someuser', 'somepass');
mysqli_select_db($conn, 'groupme');
$query = "SELECT * FROM msgs";
$result = mysqli_query($conn, $query) or die (mysqli_error($con));
echo "<table>";
while($row = mysqli_fetch_array($result)) {
echo"<tr><td>" . $row['date'] . "</td><td>" . $row['user'] . "</td><td>" . $row['msg'] . "</td></tr>";
}
echo "</table>";
mysqli_close($conn);
?>
</center>