I just learned mysqli since Mysql_ queries is deprecated and people keep telling me to use mysqli instead
so for starter I make a simple code to connect, insert and show data I have no problem making connection, inserting data to database but I cannot show the data using mysqli_fetch_array
here is my code :
<?php
$sql=("SELECT * from data_orang");
$hasil=mysqli_query($con,$sql);
while(mysqli_fetch_array($hasil)){
echo "nama : $hasil[nama] <br>
umur : $hasil[umur] <br>
kelamin : $hasil[kelamin] <br>";
}
?>
this is what I've tried
echo " nama : $hasil['nama'] <br>
umur : $hasil['umur'] <br>
kelamin : $hasil['kelamin'] <br>
I also tried adding mysqli_assoc and mysqli_free_result($hasil) but it does not work