INSERT INTO `echipe` (`id`, `nume_echipa`, `victorii`, `infrangeri`, `steag`) VALUES
(1, 'Trencin', 0, 0, '/img/Trencin.png'),
(2, 'Astra', 0, 0, '/img/Astra.png');
所以我想做这样的事情
Astra vs Trencin,但要从表中指定 id 并显示名称和其他信息。
我的 php 脚本
<?php
$con=mysqli_connect("localhost", "root", "", "pariuri");
// check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysql_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM echipe");
while($row = mysqli_fetch_array($result))
{
echo $row['id'] . " " . $row['nume_echipa'];
echo "<br>";
}
mysqli_close($con);
?>