|
 |
|
ขอปรึกษาผู้รู้ทั้งหลาย หากเรามีภาพจำนวนเยอะ แต่จะใส่ในเว็บเพจ จำเป็นต้องอัพโหลด ภาพลงฐานข้อมูลก่อน เลยหรือ ทำการสร้าง Album ด้วย Dream หรือ photoshop ได้เลย |
|
 |
|
|
 |
 |
|
เก็บชื่อลงในฐานข้อมูลครับ
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
mysql_connect("localhost","root","root") or die (mysql_error());
mysql_select_db("mydatabase");
for($i=1;$i<=(int)($_POST["hdnLine"]);$i++)
{
if($_FILES["fileUpload".$i]["name"] != "")
{
if(move_uploaded_file($_FILES["fileUpload".$i]["tmp_name"],"thaicreate/".$_FILES["fileUpload".$i]["name"]))
{
$strSQL = "INSERT INTO gallery ";
$strSQL .="(GalleryName,Picture) VALUES ('".$_POST["txtGalleryName".$i]."','".$_FILES["fileUpload".$i]["name"]."')";
mysql_query($strSQL);
echo "Copy/Upload ".$_FILES["fileUpload".$i]["name"]." completed.<br>";
}
}
}
echo "<br><a href='php_multiple_upload3.php'>View file</a>";
mysql_close();
?>
</body>
</html>
Go to : PHP MySQL Upload File to MySQL Database - Multiple Dynamic CreateElement Input File Upload
|
 |
 |
 |
 |
Date :
2011-06-30 06:17:01 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ก่อนอื่นขอขอบคุณก่อนครับ อยากให้พี่มาตอบนานแล้ว
ขอถามพี่ วินต่อเลยนะครับ ผมทำระบบยืมคืนตัวปริญญานิพนธ์(รูปเล่ม)ของโปรเจ็ค
แล้วเวลาเรียกมาแสดงเราจะสามารถ แบ่งรูปของหนังสือแต่ล่ะเล่มยังไง
ปริญญานิพนธ์(รูปเล่ม)แต่ล่ะเล่ม มีรูปประมาณ 5-10 รูป ปริญญานิพนธ์(รูปเล่ม)มีประมาณ 200 เล่ม
สอนหน่อยนะครับ มือใหม่ (โปรเจ็คจบ)
|
 |
 |
 |
 |
Date :
2011-06-30 17:58:41 |
By :
momanclub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณสร้าง table ไว้เก็บ path ที่จะได้ยังรูปครับ
แล้วเวลาเรียกก็เหมือนเรียกรูปธรรมดาอ่ะครับ
<img src="<?echo $path_to_img; ?>" alt="" />
|
 |
 |
 |
 |
Date :
2011-06-30 18:04:28 |
By :
oxygenyoyo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หลัก ๆ ก็มี 2 ตารางครับ
- ตารางเก็บข้อมูล ปริญญานิพนธ์
- ตารางเก็บข้อมูล รูปภาพ
ความสั้มพันธ์แบบ 1 ต่อกลุ่ม
|
 |
 |
 |
 |
Date :
2011-06-30 18:45:35 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอขอบคุณ พี่OxyGenyoyoและพี่วิน นะครับ
จะพยายามทำดูก่อนนะครับ ถ้าติดอะไร จะมาถามใหม่ครับ
ขอบคุณอีกครั้ง
|
 |
 |
 |
 |
Date :
2011-06-30 23:43:47 |
By :
momanclub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับพี่วิน เพิ่งกลับ มาจากเลือกตั้งวันนี้
|
 |
 |
 |
 |
Date :
2011-07-04 09:54:44 |
By :
momanclub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|