我創建了一個數據庫來顯示視頻內容。我試圖將視頻剪輯作爲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標籤。因此,請將這些路徑包裹在適當的標籤中,並且您很好。只顯示路徑不會做任何事情 –