dsc862009 2018-05-18 12:53
浏览 12
已采纳

如果isset语句不正确

I want to check if the reaction count is 0 then go in the if statement. The part without && ($app->count_reactie($topic['id']) == 0) does work but when I add this it won't work.

In the line above this code I use: implode($app->count_reactie($topic['id']))and it works so it is not that this code doesnt work. This code will return the number of reactions.

But this code down below is what I am trying to get to work.

if(isset($actiefboardid)){
  $toppic = $app->get_topics($actiefboardid);
    foreach($toppic as $topic){
    if(isset($_SESSION['klant_id']) && ($_SESSION['klant_id'] == $topic['klant_id']) && ($app->count_reactie($topic['id']) == 0)){ 

}}}

Hopefully someone can help me.

  • 写回答

1条回答 默认 最新

  • duanba5777 2018-05-18 13:23
    关注

    Try this:

    $count = $app->count_reactie($topic['id']);
    
    if(isset($_SESSION['klant_id']) && ($_SESSION['klant_id'] == $topic['klant_id']) 
    && ($count['COUNT(reactie)'] == 0)){
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化