<?
function save_pic_to_db($file,$file_name,$file_type)
{
global $DB; if( $file == "" || $file == "none" )
{
return 0;
} $image_content = addslashes(fread(fopen($file,"r"),filesize($file)));
$DB->query("insert into PIC values(null,'$file_name','$file_type','$image_content')"); return $DB->insert_id();
}
?>
function save_pic_to_db($file,$file_name,$file_type)
{
global $DB; if( $file == "" || $file == "none" )
{
return 0;
} $image_content = addslashes(fread(fopen($file,"r"),filesize($file)));
$DB->query("insert into PIC values(null,'$file_name','$file_type','$image_content')"); return $DB->insert_id();
}
?>
你去看看这篇文章吧,比较详细了
我按照sunblue(猫总要吃老鼠的) 介绍的文章做的。可是当传完图片后,数据库没有任何变化。无论我传输几张图片,返回的ID永远是0。请问为什么? 我用的是win98+PHPTriad2.11“Server API”是CGI。和这有关系吗?