I have a database "media" with table "video"
CREATE TABLE IF NOT EXISTS `video` (
`id` int(12) NOT NULL AUTO_INCREMENT,
`title` varchar(25) NOT NULL,
`link` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
table video contains 3 fields: id, title, link (contains iframe and link to video).
I want to display all of the videos in the mysql table, but only the first video s being displayed.
<?php
$con=mysqli_connect("localhost","user","password","database");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM video");
while($row = mysqli_fetch_array($result))
{
$id = $row["id"];
$videoiframe = $row["link"];
}
echo "{$videoiframe}";
?>