I\'m trying to make a table connected to my database so I can use the information in that database.
I think I\'m on the right way, but currently the table only displ
Perhaps this is because you have not opened your HTML table tags correctly, its an easy thing to overlook. Also loop the result set inside a white statement:
$sql = "SELECT `name`,`date`,`present`,`website` FROM `dates`";
$results = mysqli_query($conn,$sql);
echo "<table>"; //begin table tag...
//you can add thead tag here if you want your table to have column headers
while($rowitem = mysqli_fetch_array($results)) {
echo "<tr>";
echo "<td>" . $rowitem['name'] . "</td>";
echo "<td>" . $rowitem['date'] . "</td>";
echo "<td>" . $rowitem['present'] . "</td>";
echo "<td>" . $rowitem['website'] . "</td>";*/
echo "</tr>";
}
echo "</table>"; //end table tag
Your code gets only one row from table, you need loop your results.
Try this code:
$results = mysqli_query($conn,$sql);
while($row = mysqli_fetch_array($results))
{
//do smth
}