爲什麼我在代碼中收到以下錯誤?致命錯誤:無法在寫入上下文中使用函數返回值
Fatal error: Can't use function return value in write context in....
我我不得不返回內聲明的,如果...否則當我第一次開始對這個功能的工作,並且錯誤似乎是一個具有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";
}
}
}
你如何使用'wallPostComments()'?顯示該代碼。 $ JSONedIdWallPosts定義在哪裏? – 2012-04-03 00:45:32