我想在一个名为videos的表中显示名为K-Movies的数据库中的视频。但我不知道怎么做。有人能帮忙吗。谢谢!
好吧,假设您的图像src存储在数据库中
$con = mysqli_connect("localhost","root","","K-Movies");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if ($result = mysqli_query($con, "select * from videos")) {
while ($fetch = mysqli_fetch_assoc($result)){
echo "<img src='". $fetch['image'] ."' />";
}
} else {
echo "Query failed";
}