|
![](/images/resource/spacer.gif) |
|
เกี่ยวกะรูปภาพ คือตอนนี้เก็บรูปภาพเป็น ใน 1 field ชื่อว่า test1.jpg เวลาเรียกก็เรียกแบบนี้ $image= $ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
มันก็ไม่ได้อะ
เราทำบันทึกไว้อย่างงี้อะ
--------------------------------------------------------------------------------------------------------------------
$filename = $HTTP_POST_FILES['QPic']['name'];
//echo "\$filename".$filename;
$filetempname = $HTTP_POST_FILES['QPic']['tmp_name'];
$filesize = $HTTP_POST_FILES['QPic']['size'];
$fp = fopen($filetempname,"r");
$data = fread($fp,filesize($filetempname));
$data = addslashes($data);
$uploaddir = 'upload_path/';
$data = basename($_FILES['QPic']['name']);
$uploadfile = $uploaddir . basename($_FILES['QPic']['name']);
$no = find_new_news();
$sql = "INSERT INTO news (No,Name_new, Detail_new,Date,Image,Status,Createby, Createdate,Modifyby,Modifydate) ";
$sql .= " values ('$no','$name','$detail','$date','$data', 'T','$user_login', '$now','$user_login','$now') ";
echo $sql."<br><br>";
$query = mysql_db_query($dbname,$sql);
------------------------------------------------------------------------------------------
อันนี้ตอนดึง
include("webboard/config.inc.php");
mysql_select_db($dbname) or die("เลือกฐานข้อมูลไม่ได้");
$sql = "select * from news where No ='$no' "; // หากต้องการดึงเฉพาะ Reccord ใด Record หนึ่ง ให้ใช้คำสั่ง where id='$ตัวแปร'
//echo "\$sql".$sql."<br><br>";
$result = mysql_query($sql) or die("ไม่สามารถ query ข้อมูลได้");
$images = mysql_fetch_array($result);
$mimetype=$result[Pro_type];
echo $images['Image'];
มันออกมาเป็นชื่อไฟล์ เช่น DSC00472.JPG
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
4 ก.ย. 2549 15:49:50 |
By :
ฝ้าย |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
อะได้ละ ขอบใจนะ p_latplee ลองไปดูโค้ด
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
4 ก.ย. 2549 16:23:57 |
By :
ฝ้าย |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 04
|