I have been trying to fill a HTML table with data from a MYSQL database using PHP. The problem I am having is that the placeholder values I have in the HTML file never display the data form MYSQL.
HTML file
<div class="container" style="background-image: url('http://www.MyWebSite.com/OurWorld/EditorBG.png');
-webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover;
background-size: repeat; padding-bottom: 5px;">
<br />
<div class="mainbody" style="background-image: url('http://www.MyWebSite.com/Test/Notepad.png');
background-repeat: no-repeat; margin-left: auto; margin-right: auto; margin-bottom: 10px;
width: 646px; height: 800px !important; min-height: 100%; overflow: hidden;">
<div class="main-form" style="margin-top: 280px; margin-left: 15px;">
<form method="GET" action="http://www.MyWebSite./Test/SuggestionSchemeForm.php">
<table align="center" bgcolor="white" BORDER=2 BORDERCOLOR=Black summary="Submitted Suggestions">
<caption bgcolor="white" BORDER=2 BORDERCOLOR=Black >Submitted Suggestions</caption>
<thead>
<tr><th>Name</th><th>Site</th><th>Status</th><th>Date</th></tr>
</thead>
<tbody>
<tr><td><input placeholder="name"></td> <td><input placeholder="site"></td> <td><input placeholder="status"></td> <td><input placeholder="date"></td></tr>
<tr><td><input placeholder="name"></td> <td><input placeholder="site"></td> <td><input placeholder="status"></td> <td><input placeholder="date"></td></tr>
<tr><td><input placeholder="name"></td> <td><input placeholder="site"></td> <td><input placeholder="status"></td> <td><input placeholder="date"></td></tr>
<tr><td><input placeholder="name"></td> <td><input placeholder="site"></td> <td><input placeholder="status"></td> <td><input placeholder="date"></td></tr>
</tbody>
</table>
</form>
</div>
</div>
PHP File
<?php
Global $USER;
$servername = "";
$username = "";
$password = "";
$dbname = "";
$firstname = $USER->firstname;
$lastname = $USER->lastname;
$testname = "BLEGH";
echo $testname;
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}
$sql = mysql_query("SELECT name, site, status, date FROM enquiries")
$result = $conn->query($sql);
while($row = mysql_fetch_array($result MYSQL_ASSOC))
{
echo "name {$row['name']}".
"site {$row['site']}".
"status {$row['status']}".
"date {$row[date]}";
}
if ($conn->query($sql) === TRUE)
{
echo "New record created successfully";
}
else
{
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
Header('Location: http://www.MyWebSite.com/index.php');
exit;
?>
mysql_andmysqli_. That will not work. Error checking would have revealed this.mysql_*functions. They are no longer maintained and are officially deprecated. Learn about prepared statements instead, and consider using PDO, it's really not hard.placeholderis just an HTML feature to show a hint text on empty input boxes. It has not relation at all to filling in values from PHP. I'm voting as Too broad, because you lack understanding of how PHP and HTML work together (MySQL aside). Following a couple of 'Hello world' examples is probably the best way to start. So so for PHP in general and for MySQL after that. Currently it seems you're biting off more than you can chew.