Show Hide div if, if statement is true

后端 未结 7 438
情歌与酒
情歌与酒 2020-12-08 15:46

My code works to a point. What I want is that when this if statement is false, the

doesn\'t show



        
相关标签:
7条回答
  • 2020-12-08 16:44

    This does not need jquery, you could set a variable inside the if and use it in html or pass it thru your template system if any

    <?php
    $showDivFlag=false
    $query3 = mysql_query($query3);
    $numrows = mysql_num_rows($query3);
    if ($numrows > 0){
        $fvisit = mysql_fetch_array($result3);
        $showDivFlag=true;
     }else {
    
     }
    
    ?>
    

    later in html

      <div id="results" <?php if ($showDivFlag===false){?>style="display:none"<?php } ?>>
    
    0 讨论(0)
提交回复
热议问题