Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/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 致命错误:Can';t在中的写入上下文中使用函数返回值_Php_Mysql_Codeigniter - Fatal编程技术网

Php 致命错误:Can';t在中的写入上下文中使用函数返回值

Php 致命错误:Can';t在中的写入上下文中使用函数返回值,php,mysql,codeigniter,Php,Mysql,Codeigniter,为什么我的代码中会出现以下错误 致命错误:无法在…中的写入上下文中使用函数返回值 当我第一次开始处理这个函数时,if…else中有return语句,这个错误似乎与return语句有关。但是我用echo语句替换了它们,我仍然得到了错误,所以我不知道发生了什么。有什么帮助或建议吗 public function wallPostComments() { // This function processes wall post comments // pull the submitte

为什么我的代码中会出现以下错误

致命错误:无法在…中的写入上下文中使用函数返回值

当我第一次开始处理这个函数时,if…else中有return语句,这个错误似乎与return语句有关。但是我用echo语句替换了它们,我仍然得到了错误,所以我不知道发生了什么。有什么帮助或建议吗

public function wallPostComments() {
    // This function processes wall post comments
    // pull the submitted comment data
    $returnedPostId = $this->inuput->post('entryId');
    $returnedCommentData = $this->input->post('returnedCommentData');

    // pull the required session data
    $userid = $this->session->userdata('userid');

    // select the sql data from wallPosts and wallPostComments
    $query = $this->db->query("SELECT * FROM wallPosts, wallPostComments");

    // loop through the mysql rows and process the expanded sql code
    foreach ($query->result() as row()) {
        if($row->idwallPosts == $JSONedIdWallPosts) {
            echo "success";
        } else {
            echo "failure";
        }
    }
}
row()
何时成为函数

尝试:

row()
何时成为函数

尝试:


您如何使用
wallPostComments()
?显示代码。
$JSONedIdWallPosts
在哪里定义?如何使用
wallPostComments()
?显示代码。
$JSONedIdWallPosts
在哪里定义?啊,每个人都有那些日子,不要难过。啊,每个人都有那些日子,不要难过。
foreach ($query->result() as $row) {