我目前正在創建一個網站,你也可以放置圖片的博客文章,我已經有代碼上傳文件,但我也想把它在我的MYSQL行中。將帖子圖片網址上傳到mysql數據庫,並把多個網址放在一行
這裏是我的post_picture.php:
<form action="" method="POST" enctype="multipart/form-data">
<label for="file">Profile Pic:</label> <input type="file" name="ProfilePic" id="ProfilePic" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
$con = mysql_connect("localhost", "a1070rik", "");
mysql_select_db("portals",$con);
if(isset($_POST[submit])){
$ProfilePicName = $_FILES["ProfilePic"]["name"];
$ProfilePicType = $_FILES["ProfilePic"]["type"];
$ProfilePicSize = $_FILES["ProfilePic"]["size"];
$ProfilePicTemp = $_FILES["ProfilePic"]["tmp_name"];
$ProfilePicError = $_FILES["ProfilePic"]["error"];
$RandomAccountNumber = uniqid();
move_uploaded_file($ProfilePicTemp, "Content/" . $RandomAccountNumber . ".png");
}
?>
這裏是我的MYSQL表結構的圖片: Picture 同時,我希望擁有多個圖像的URL在一排,這可能嗎?
謝謝。
編輯:查詢
額外信息: 我的數據庫名稱是 「portalen」 和行名稱爲 「leerlingen」。
謝謝你將看到。你也可能知道如何把它放在我的MYSQL行中? –
您的帖子沒有提供足夠的信息來爲您建立查詢。 – BeoWulf
檢查編輯,現在好嗎? –