I have problem display database use if and while in code me.
Where I have 4 data in database.
I want display all data with using if, but it only displays 1 data.
if($Z = mysqli_fetch_assoc($Y)){
<!-- Data all display -->
} else {
}
and me using data with while, data all display
while($Z = mysqli_fetch_assoc($Y)){
<!-- Data all display -->
}
How to display all data using if?