Also, I would suggest you to use PDO instead. Your code is very vulnerable to SQL injection attacks. Even if your website only has a few visitors, it’s always cosidered as the best practice to take security measures
Here’s some code for you in PDO:
<?php
$servername = '<YOUR_SERVER_NAME>'; // In this case: sql311.epizy.com
$dbname = '<YOUR_DATABASE_NAME>'; // Make sure your database is correct
$username = '<YOUR_USERNAME>'; // In this case: (epiz_27699881)
$password = '<YOUR_PASSWORD>'; // MAKE SURE YOUR PASSWORD IS CORRECT!!! If you are using a $ in your password, you'll need to escape it (\$)
try {
$dbh = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$sql = "SELECT * FROM someplace WHERE somefield=".$_SESSION['id'];
$users = $dbh->query($sql);
echo '<table class="table">
<tr>
<td>Name</td>
<td>Quantity</td>
</tr>';
foreach ($users as $row) {
echo "<tr><td>".$row['id']."</td><td>".$row['name']."</td></tr>";
}
$dbh = null;
}
catch (PDOexception $e) {
echo "Error is: " . $e-> etmessage();
}
?>