但我不知道如何以及在哪里将 sql 代码放在 php 中,有人可以帮我吗?我知道它像SELECT * FROM form ORDER BY 'Klant_id' ASC LIMIT 1
<html>
<header>
<link rel="stylesheet" href="css/style.css" type="text/css" />
</header>
<body>
<?php
//makes an connection to the db
mysql_connect("localhost", "root", '') or die(mysql_error());
mysql_select_db('databaseimage') or die(mysql_error());
$data = mysql_query("SELECT * FROM form ORDER BY 'Klant_id' ASC LIMIT 1")
or die(mysql_error());
echo "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data))
{
echo "<tr>";
echo "<th>surname:</th> <td>".$info['Surname'] . "</td> ";
echo "<th>insertion:</th> <td>".$info['Insertion'] . "</td> ";
echo "<th>initials:</th> <td>".$info['Initials'] . "</td> ";
echo "<th>name:</th> <td>".$info['Name'] . "</td> ";
echo "<th>sex:</th> <td>".$info['Sex'] . "</td> ";
echo "<th>adress:</th> <td>".$info['Adress'] . "</td> ";
echo "<th>postcode:</th> <td>".$info['Postcode'] . "</td> ";
echo "<th>location:</th> <td>".$info['Location'] . "</td> ";
echo "<th>private phone:</th> <td>".$info['Private_phone'] . "</td> ";
echo "<th>mobile phone:</th> <td>".$info['Mobile_phone'] . "</td> ";
echo "<th>work phone:</th> <td>".$info['Work_phone'] . "</td> ";
echo "<th>private email:</th> <td>".$info['Private_email'] . "</td> ";
echo "<th>work email:</th> <td>".$info['Work_email'] . "</td> ";
}
Print "</table>";
?>
</body>
</html>