Php 致命错误:Can';t在中的写入上下文中使用函数返回值
为什么我的代码中会出现以下错误 致命错误:无法在…中的写入上下文中使用函数返回值 当我第一次开始处理这个函数时,if…else中有return语句,这个错误似乎与return语句有关。但是我用echo语句替换了它们,我仍然得到了错误,所以我不知道发生了什么。有什么帮助或建议吗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
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) {