 |
|
อยากทราบโค๊ด PHP อัปรูปลงฐานข้อมูลโดยไม่ใช้เอาไปเก็บใน โฟล์เดอร์ แต่รูปลงฐานข้อมูลโดยตรง ฐานข้อมูลเป็น Oracle ฟิลด์ที่ใช้เก็บรูป Type แบบ BLOB ช่วยหน่อยได้หรือป่าวครับกำลังทำโปรเจ็คแต่ อาจารย์บังคับให้ทำแบบนี้ หาโค๊ดมาตั้งนาน ยังไม่ได้เลย เลยอยากหาคนที่เก่งช่วยบอกได้ไหมครับ
ขอบคุณนะครับถ้าจะช่วยผม
Code (PHP)
if($_FILES['upfile']['error']!=0) {
$msg = "การ Upload เกิดข้อผิดพลาด";
}
else {
$file = $_FILES['upfile']['tmp_name'];
$file_handle = fopen($file, "r");
$file_data_ = fread($file_handle, filesize($file));
$file_data = addslashes($file_data_);
fclose($file_handle);
$name = $_FILES['upfile']['name'];
$type = $_FILES['upfile']['type'];
$size = $_FILES['upfile']['size'];
Include ("phpOracleConnect.php");
$queryadd = "INSERT INTO image(img_data,img_name,img_type,img_size)VALUES('$file_data', '$name', '$type', '$size')";
$o_parse = ociparse($objConnect,$queryadd);
ociexecute($o_parse,OCI_DEFAULT);
oci_close($objConnect);
}
มันเกิด ERROR คร๊าบช่วยทีคร๊าบ
Warning: ociparse() [function.ociparse]: ORA-00972: ตัวระบุยาวเกินไป in C:\AppServ\www\testRestaurant\upload_to_db_ss.php on line 23
Warning: ociexecute() expects parameter 1 to be resource, boolean given in C:\AppServ\www\testRestaurant\upload_to_db_ss.php on line 24
หมดปัญญาที่จะแก้ครับใครก็ได้ช่วยผมหน่อยขอร้องครับ
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2010-03-14 23:50:23 |
By :
monkeyict |
View :
1699 |
Reply :
7 |
|
 |
 |
 |
 |
|
|
|
 |