I am creating a page where i want to show the div based on the if condition of fetched data from database
values in database:
| username | formvalue |
|---|---|
| user1 | 11 |
| user1 | 12 |
| user1 | 13 |
Php code
sql = "SELECT formvalue, username FROM demotable where username = '".$_SESSION['username']."' ";
$execute = mysqli_query($con, $sql);
if(mysqli_num_rows($execute) >= 1){
while ($row = mysqli_fetch_assoc($execute)) {
$checkcon = $row['formvalue'];
}
}
output code i need(but it is showing only div third)
<?php if($checkcon == '11' ){ ?>
<div>
Div first
</div>
}
?>
<?php if($checkcon == '12' ){ ?>
<div>
Div second
</div>
}
?>
<?php if($checkcon == '13' ){ ?>
<div>
Div third
</div>
}
?>
b