I have the following code that allows me to upload a file to a database but I have cannot get that file to playback on my html page:
<!DOCTYPE html>
<html>
<head>
<link href="site.css" rel="stylesheet">
<title>A</title>
<meta http-equiv="content-type" content="text-html; charset=utf-8">
</head>
<body style="background-color:black">
<?php
define('DB_Name', 'gaufensr_abs3x');
define('DB_User', 'gaufensr_owner');
define('DB_Password', 'Mlee@0407');
define('DB_Host', 'localhost');
$link = mysql_connect(DB_Host, DB_User, DB_Password);
if (!$link) {
die('could not connect:' . mysql_error());
}
$db_selected = mysql_select_db(DB_Name, $link);
if (!@db_selected) {
die('can\t use' . DB_Name. ': ' . mysql_error());
}
echo 'CONNECTED SUCCESSFULLY';
$value = $_Post['submit'];
$sql = "INSERT INTO videos (video_name) VALUES ('$value')";
if (!mysql_query($sql)) {
die('ERROR: ' .mysql_error());
}
mysql_close();
?>
<?php
if (isset($_GET['id']))
{
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM 'videos' WHERE id='$id'");
while($row = mysql_fetch_assoc($query))
{
$id = $row['id'];
$video_name = $row['video_name'];
}
echo "You are watching " .$video_name. "<br />";
echo "<embed src='$id' width='560' height='315'></embed>";
}
else
{
echo "Error!";
}
?>
</body>
</html>
When i upload a file I get the following error:CONNECTED SUCCESSFULLY Error! I am just learning php and mysql; Any help would be great. Thanks in advance you guys.