douwu8524 2017-06-08 11:40
浏览 11

循环记录直到to_reference id不等于0并且还应用和/或条件

I am stuck to the following problem.I am applying page logic to the website which is survey kind of data. I am unable to fetch the records in loop till the from_reference_id tends to null, And also there can be and/or condition between the two reference from_reference_id and to_reference_id and loop ends till to_reference_id tends to null.Also there can be and/or condition between the reference id which is being matched with the answer provided on the survey. The aggregate result will defined the page redirection. As for example from_reference_id is 1 and to to_reference is 2 then based on the question it will be solved as equation like this. So I just want to route page to be redirected.

if(q1:a1) is selected then goto page 3
or (q2:a1) is selected then goto page 3

where q1 represent question and a1 denotes answer1 Here is the database structure https://i.stack.imgur.com/9CWHT.png

the code I have tried

$sql_select_query="SELECT * from `tbl_branching_logic` where `p_id`='$page_id' and `s_id`='$global_survey_id' and `r_id`='$r_id'";
        $result=mysql_query($sql_select_query);    
    while($row=mysql_fetch_assoc($result))
    {
      if($row['to_reference_id']!=0 && $row['and_or']!='')
      {
          //condition

      }
    }

This is the html structure image enter image description here

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大