我创建了一个数据库来显示视频内容。我试图将视频剪辑作为longblob存储在我的数据库中,但文件太大。我的视频剪辑以高清格式录制,这是拍摄清晰画面所必需的。在phpmyadmin数据库中存储视频
我试图将文件路径作为varchar存储在我的数据库中,但我不确定是否正确。我将视频的位置存储在我的电脑上。
我的一个文件路径如下:C:/ wamp/www/com904/eNISAT/Password/Change Password Tutorial.wmv。
我试图从我的表中选择所有从我的PHP页面displayVideos.php显示视频,但我得到我的HTML表中的文本路径输出。
这是我的displayVideos.php文件中的代码。
<?php
require_once("db_connection.php");
//Start session
/*
Sessions is a mechanism to preserve data across subsequent accesses. Using sessions, a website is able to maintain state, that is,
remember which requests they received previously. Without sessions, websites would not have progressed beyond simple static HTML pages.
*/
session_start();
//Select database
$database = "com904";
$db = mysql_select_db($database) or die("Unable to select database");
include_once 'db_connection.php';
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>File Uploading With PHP and MySql</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body bgcolor="sky blue">
<center>
<div id="header">
<h1> Click on each video to view your tutorials <h1/>
</div>
<div id="body">
<table width="80%" border="1"bgcolor = "white">
<tr>
<th colspan="4">Your eNISAT Tutorials
</tr>
<tr>
<td>Support Question</td>
<td>Video</td>
</tr>
<?php
$sql="SELECT * FROM enisatquestion";
$result_set=mysql_query($sql);
while($row=mysql_fetch_array($result_set))
{
?>
<tr>
<td><?php echo $row['eNISATQuestion'] ?></td>
<td><?php echo $row['eNISATVideo'] ?></td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>
它应该是'localhost/com904/eNISAT /密码/更改密码Tutorial.wmv'或'127.0.0.1t/com904/eNISAT /密码/更改密码Tutorial.wmv' – Matt
1.没有这样的东西“phpmyadmin database” – 2016-01-13 01:52:24
如何在网页上显示视频?使用适当的html标签。因此,请将这些路径包裹在适当的标签中,并且您很好。只显示路径不会做任何事情 –