友情链接模块BUG,点删除不执行且无法编辑

创建时间:2019-05-16 19:10发布者:D.41302点击数:26
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /wwwroot/include/mysql.class.php on line 116

上面是错误提示,另外点击“删除”卡死在跳转界面,也无法更改友情链接
回答 我也遇到这个问题(0)
D.413022019-05-21 11:40回答
删除友链BUG解决方法:
/**
* +----------------------------------------------------------
* 友情链接删除
* +----------------------------------------------------------
*/
elseif ($rec == 'del') {
// 验证并获取合法的ID
$id = $check->is_number($_REQUEST['id']) ? $_REQUEST['id'] : $dou->dou_msg($_LANG['illegal'], 'link.php');

$link_name = $dou->get_one("SELECT link_name FROM " . $dou->table('link') . " WHERE id = '$id'");

if (isset($_POST['confirm'])) {
$dou->create_admin_log($_LANG['link_del'] . ': ' . $link_name);

//将下面这句错误的
$dou->delete($dou->table('link'), "id = $id", "link.php");
//替换为下面这句正确的
$dou->delete('link', "id = '$id'", 'link.php');

} else {
$_LANG['del_check'] = preg_replace('/d%/Ums', $link_name, $_LANG['del_check']);
$dou->dou_msg($_LANG['del_check'], 'link.php', '', '30', "link.php?rec=del&id=$id");
}
}


编辑友链BUG解决方法:

/**
* +----------------------------------------------------------
* 友情链接编辑
* +----------------------------------------------------------
*/
elseif ($rec == 'edit') {
// 验证并获取合法的ID
$id = $check->is_number($_REQUEST['id']) ? $_REQUEST['id'] : '';
$query = $dou->select($dou->table('link'), '*', '`id` = \'' . $id . '\'');

// 删掉下面这句
$link = $dou->fetch_array($query);



小白一枚,目前按上面这样弄好像就正常了,不知道是不是正确的处理方法
有用(0) 没用(0)