0
自分の音楽情報とアルバムアートを含むテーブルを作成しました。私はMysqlとPHPを使ってテーブルを作成し、画像を実装しています。私はこのテーブルに私の音楽をどのようにアップロードするのか分かりません。助けてもらえますか?phpとmysqlを使って音楽をアップロードするにはどうすればいいですか?
再生列に私の音楽が表示され、再生する必要があります。
And this is where my audio files are
そして、ここに私のコードです:
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "jukebox";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM Music";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table>
<tr>
<th>Artist</th>
<th>Title</th>
<th>Album</th>
<th>Albumcover</th>
<th>Play</th>
</tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo
"<tr>
<td>" . $row["Artist"]. "</td>
<td>" . $row["Title"]. "</td>
<td>" . $row["Album"]. "</td>
<td><img src='/jukebox/img/" . $row["Albumcover"] ."' alt=".$row["Albumcover"]."></td>
<td>" . $row["Play"] . "></td>
</tr>";
}
echo "</table>";
} else {
echo "0 results";
}
?>
</body>
</html>
htmlタグを使用して音声を再生できます。 [ここ](http://www.w3schools.com/tags/tag_audio.asp)これはあなたを助けるかもしれません –
どこabouts私はこのコーディングを置くだろうか?そして、私が保存した音楽をコーディングにどのようにリンクさせるのですか? –