/*------------------- IMAGE QUERY ---------------*/ $file =$_FILES['image']['tmp_name']; if(!isset($file)) { echo 'Please select an Image'; } else { $image_check = getimagesize($_FILES['image']['tmp_name']); if($image_check==false) { echo 'Not a Valid Image'; } else { $image = file_get_contents ($_FILES['image']['tmp_name']); $image_name = $_FILES['image']['name']; if ($image_query = mysql_query ("insert into product_images values (1,'$image_name',$image )")) { echo $current_id; //echo 'Successfull'; } else { echo mysql_error(); } } } /*----------------- IMAGE QUERY END ---------------------*/ <form action='insert_product.php' method='POST' enctype='multipart/form-data' ></br> File : <input type='file' name= 'image' > </form>
错误消息:您的SQL语法有错误;请检查与MySQL服务器版本相对应的手册,以获得在第1行使用Next‘的正确语法。
动漫人物