大家好,我想**使用多个复选框并将它们的值插入数据库,但我收到此错误消息:'Warning: join() [function.join]: Invalid arguments passed in C';
下面是代码:
<?php
require_once('db_conn.php'); $cat=$_POST['cat'];
if(isset($_FILES['file_upload']) && isset($cat))
{
$shuff=str_shuffle("ABD6565LSLFKDSAJFD");
$food = join(', ', $_POST['food']);
mkdir("upload/$shuff");
$files=$_FILES['file_upload'];
for($x = 0; $x <count($files['name']); $x++)
{
$name=$files['name'][$x];
$tmp_name=$files['tmp_name'][$x];
if(move_uploaded_file($tmp_name, "upload/$shuff/".$name))
{
$query="INSERT INTO image(mid, cid, name, food, path) VALUES('', '$cat', '$name', '$food', 'upload/$shuff/$name')";
mysql_query($query);
echo 'The file '.$name. ' uploaded successfully'. '<br \>';
}
else
{
echo 'uploading failed';
}
}
}
?>