Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用单个表以不同形式查看codeigniter中数据库中的多个复选框值_Php_Codeigniter - Fatal编程技术网

Php 如何使用单个表以不同形式查看codeigniter中数据库中的多个复选框值

Php 如何使用单个表以不同形式查看codeigniter中数据库中的多个复选框值,php,codeigniter,Php,Codeigniter,告诉我如何使用单个表以不同形式查看codeigniter中数据库中的多个复选框值。 这是我已经完成的代码。请帮帮我 这是错误显示 遇到一个PHP错误 严重性:通知 消息:数组到字符串转换 文件名:database/DB\u query\u builder.php 电话号码:683 回溯: 文件:D:\xampp\htdocs\homestaynew\web\application\models\Main\u Model.php 电话号码:165 功能:在哪里 文件:D:\xampp\htdocs

告诉我如何使用单个表以不同形式查看codeigniter中数据库中的多个复选框值。
这是我已经完成的代码。请帮帮我

这是错误显示

遇到一个PHP错误 严重性:通知

消息:数组到字符串转换

文件名:database/DB\u query\u builder.php

电话号码:683

回溯:

文件:D:\xampp\htdocs\homestaynew\web\application\models\Main\u Model.php 电话号码:165 功能:在哪里

文件:D:\xampp\htdocs\homestaynew\web\application\controllers\Main.php 电话号码:929 函数:updateData2

文件:D:\xampp\htdocs\homestaynew\index.php 电话号码:315 功能:需要一次

发生数据库错误 错误号码:1064

您的SQL语法有错误;检查与您的MariaDB服务器版本对应的手册,以了解在第1行的“134=”附近使用的正确语法,其中
id
=
Array

更新
hostmain
SET 134='',其中
id
=
Array

文件名:D:/xampp/htdocs/homestaynew/system/database/DB_driver.php

电话号码:691

查看

    <?php foreach ($result as $key => $row) {?>

     <input type="hidden" name="id" value="<?= $row['id'] ?>"> 

        <input type="hidden" name="propertytype" value="<?= $row['propertytype'] ?>">



    <input type="hidden" name="guesthave" value="<?= $row['guesthave']  ?>">
 <input type="hidden" name="guestaccomodate" value="<?= $row['guestaccomodate'] ?>">
    <input type="hidden" name="bedroomuse1" value="<?= $row['bedroomuse1'] ?>">

     <input type="hidden" name="guestbedroom" value="<?= $row['guestbedroom'] ?>">
     <input type="hidden" name="guest1" value="<?= $row['guest1'] ?>">
    <input type="hidden" name="guest2" value="<?= $row['guest2'] ?>">
     <input type="hidden" name="guest3" value="<?= $row['guest3'] ?>">
    <input type="hidden" name="guest4" value="<?= $row['guest4'] ?>">
     <input type="hidden" name="bedroomuse2" value="<?= $row['bedroomuse2'] ?>">
     <input type="hidden" name="guest5" value="<?= $row['guest5'] ?>">
     <input type="hidden" name="guest6" value="<?= $row['guest6'] ?>">

         <input type="hidden" name="guest7" value="<?= $row['guest7'] ?>">
     <input type="hidden" name="guest8" value="<?= $row['guest8'] ?>">
     <input type="hidden" name="bedroomuse3" value="<?= $row['bedroomuse3'] ?>">

   <input type="hidden" name="bathroom_accomodate[]" value="<?= $row['bathroom_accomodate'] ?>" >

      <input type="hidden" name="bathroomused" value="<?= $row['bathroomused'] ?>">

      <input type="hidden" name="location" value="<?= $row['location'] ?>">

      <input type="hidden" name="amenities[]"  value="<?= $row['amenities']  ?>">
         <input type="hidden" name="sharedspaces[]"  value="<?= $row['sharedspaces'] ?>">
  <?php  } ?>
$components=array(array('component_-key'=>'address')、array('component_-key'=>'education');
$client_details=数组('address'=>1);
foreach($key=>$value的组件)
{
$data=数组('name'=>'组件[]',
'value'=>$value['component_key'],
“选中”=>($client\u details[$value['component\u key']]==1)?真:假
);
回声“;
echo form_复选框($data)。$value['component_key'];
回声“;
回声“;
}
  $bathroom_accomodate =implode(',',$this->input->post('bathroom_accomodate'));
        $bathroomused = $this->input->post('bathroomused');

        $location=$this->input->post('location');
        $amenities=implode(',',$this->input->post('amenities'));
        $sharedspaces=implode(',',$this->input->post('sharedspaces'));
$components = array(array('component_key' => 'address'),array('component_key' => 'education'));

$client_details = array('address' => 1);

foreach ($components as $key => $value)
{

  $data = array('name'          => 'components[]',
                'value'         => $value['component_key'],
                'checked'       => ($client_details[$value['component_key']] == 1) ? TRUE : FALSE
            );
  echo "<div class='col-md-4 col-sm-12 col-xs-4 form-group'><div class='checkbox'><label>";
  echo form_checkbox($data).$value['component_key'];
  echo "</label></div></div>";
  echo "<div class='clearfix'></div>";
}