两个等号$article['user_id'] !== $userId 包括已经设置 $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE);
就是报错 Fatal error: Uncaught exception 'Exception' with message '你无权编辑此文章' in D:\phpStudy\WWW\lib\Article.php:85 Stack trace: #0 \WWW\index.php(13): Article->edit(7, '\xE5\xA4\xAA\xE9\x98\xB3', '', 3)
就是报错 Fatal error: Uncaught exception 'Exception' with message '你无权编辑此文章' in D:\phpStudy\WWW\lib\Article.php:85 Stack trace: #0 \WWW\index.php(13): Article->edit(7, '\xE5\xA4\xAA\xE9\x98\xB3', '', 3)
2017-04-03
public function edit($articleId, $title, $content, $userId) {
$article = $this->view($articleId);
/*var_dump($article); var_dump($article['user_id']); var_dump($userId);打印出来都是 int7 还是报错 请指教 */ if ($article['user_id'] != $userId){throw new Exception('你无权编辑此文章',ErrorCode::EDIT_NOT_AUTH);
$article = $this->view($articleId);
/*var_dump($article); var_dump($article['user_id']); var_dump($userId);打印出来都是 int7 还是报错 请指教 */ if ($article['user_id'] != $userId){throw new Exception('你无权编辑此文章',ErrorCode::EDIT_NOT_AUTH);
2017-04-03
已采纳回答 / 慕圣0362214
yahei consolas hybrid,看来题主和我一样有美学追求~链接: https://pan.baidu.com/s/1jIwpE30 密码: 23a1
2017-04-02