Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.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中插入一个值_Php_Insert - Fatal编程技术网

在php中插入一个值

在php中插入一个值,php,insert,Php,Insert,我想将groupID插入数据库 这是我的模型 public function getgroupID() { $username = $this->session->userdata('username'); $query = $this->db->query("select groupID from groups where member01ID='$username'"); return $query->result(); } 这是我的看

我想将groupID插入数据库 这是我的模型

public function getgroupID()
{
    $username = $this->session->userdata('username');
    $query = $this->db->query("select groupID from groups where member01ID='$username'");
    return $query->result();
}
这是我的看法

<?php foreach ($id as $row) {
    echo "<option value='" . $row->groupID . " '  >" . $row->groupID . " </option>";
} ?>

您是否让用户提交表单,或者在用户进行选择时是否触发了一些ajax调用,或者什么?您试图在数据库中插入什么内容?是什么阻止你插入记录?