我正在尝试上传带有标题和描述的图像以及图像上传。我的图像上传和文本输入分开工作,文本和图像路径也插入到数据库中,但我仍然不知道如何将两者结合起来
我使用了http://codeigniter.com/user_guide/libraries/file_uploading.html中给出的指南
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}
有人可以告诉我如何将一些文本字段与图像上传表单一起插入到 sql 数据库中吗?