我正在使用此代码将图像路径存储在数据库中,但它不起作用,所以任何人都可以告诉我此代码有什么问题吗?我尝试将这些图像保存在 sql 中的数组中。那我该怎么办呢。提前致谢
foreach ($_FILES["image_party"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$ofname1 = $_FILES["image_party"]["name"][$key];
$fnm1 = $_FILES["image_party"]["tmp_name"][$key];
$location = "../wp-content/plugins/".dirname(plugin_basename(__FILE__))."/uploads/".$ofname1;
move_uploaded_file($fnm1,$location);
CreateimageThumb("../wp-content/plugins/".dirname(plugin_basename(__FILE__))."/uploads/".$ofname1,"../wp-content/plugins/".dirname(plugin_basename(__FILE__))."/thumbnail/".$ofname1,140,140);
$datos_uno=implode(",", $ofname1);
$table_name1 = $wpdb->prefix ."pimages";
$query1="INSERT INTO ". $table_name1 . " set storiesid = '".$lid."',partyimg = '".$datos_uno."'";
mysql_query($query1); //echo $query1; exit; //$lid = mysql_insert_id(); //echo $query1; exit;
}
}