小编Ser*_*ncu的帖子

致命错误:无法使用mysqli_result类型的对象

当我注意到我的一个mod给了我这个错误时,我即将打开我的网站:

致命错误:不能在第303行的/var/www/vbsubscribetouser.php中使用mysqli_result类型的对象作为数组

我去了第303行,这是我发现的:

//Check if requested username can be followed.
if (in_array($followingdata['usergroupid'], explode("|", $vbulletin->options['subscribetouser_usergroups_cannot']))){
Run Code Online (Sandbox Code Playgroud)

以下是从第303行开始的所有代码:

//Check if requested username can be followed.
if (in_array($followingdata['usergroupid'], explode("|", $vbulletin->options['subscribetouser_usergroups_cannot']))){
    exit;
}

if ($followinginfo[subscribers] > 0){
    $user_followers = $followinginfo[followers].$userinfo[userid].'|';
}
else{
    $user_followers = '|'.$userinfo[userid].'|';
}

$vbulletin->db->query_write("
    UPDATE " . TABLE_PREFIX . "user
    SET subscribers = subscribers + 1, `followers` = '$user_followers'
    WHERE userid = $followinginfo[userid]
");
Run Code Online (Sandbox Code Playgroud)

我不是php编码的专家,所以在打开网站之前会有一些帮助.任何帮助/建议?

非常感谢你!

php arrays mysqli

10
推荐指数
1
解决办法
6万
查看次数

作为可投票的Ajax失败

我是ruby的新手,我只是玩了一个演示应用程序.我已经包含了gem的act_as_votable,它的效果非常好,除了一个事实,我把它丢失了...... ajax.一直刷新页面有点乏味,所以我"试着"实现ajax,但没有运气:(.经过两个小时的资源后我觉得我什么也做不了.我需要帮助实现ajax on向下和向上投票.非常感谢.

这是我的代码:

entries_controller.rb

  def upvote
    @entry = Entry.find(params[:id])
    unless current_user.voted_for? @entry
      @entry.vote_total = @entry.vote_total + 1
      @entry.save
      @entry.upvote_by current_user
    else
      flash[:danger] = 'Sorry!! You had allready voted this entry!'
    end
    redirect_to :back
  end

  def downvote
    @entry = Entry.find(params[:id])
    unless current_user.voted_for? @entry
      @entry.vote_total = @entry.vote_total + 1
      @entry.save
      @entry.downvote_by current_user
    else
      flash[:danger] = 'Sorry!! You had allready voted this entry!'
    end
    redirect_to :back
  end
Run Code Online (Sandbox Code Playgroud)

_entry.html.erb(在条目文件夹中)

<aside class="vote-count bind-<%= entry.id %>">
  <%= link_to like_entry_path(entry), :remote => true, method: :put, class: …
Run Code Online (Sandbox Code Playgroud)

ajax ruby-on-rails

6
推荐指数
1
解决办法
1512
查看次数

标签 统计

ajax ×1

arrays ×1

mysqli ×1

php ×1

ruby-on-rails ×1