Fatal error: Can't use function return value in write context in

Why am I getting the following error in my code?

Fatal error: Can't use function return value in write context in....

II had return statements inside the if...else when i first started working on this function, and the error seems like one that has to do with return statements. but i replaced them with echo statement's and I'm still getting the error's so I have no clue what's going on. Any help or advise?

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";
        }
    }
}

When did row() become a function?

Try:

foreach ($query->result() as $row) {
链接地址: http://www.djcxy.com/p/69248.html

上一篇: 致命错误:无法在empty()的写入上下文中使用方法返回值

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