Z.Kirik
Z.Kirik

Reputation: 121

Php mysql fetch array repetitive index problem

I want to remove the number indexes in the following output

Array ( [0] => 7593 [id] => 7593 [1] => Atakan [ad] => Atakan [2]

intended

Array ([id] => 7593 [ad] => Atakan [2]

my code

     global $durum;
 $array = Array();
 $sql="select * from bird_table_uye order by id desc";
 $query=phpmkr_query($sql,$durum);
 $i=0;


 while ($row=phpmkr_fetch_array($query)) {
  $array[$i]=$row;

   $i++;
 }
 print_r($array);

Upvotes: 0

Views: 66

Answers (1)

Varun Malhotra
Varun Malhotra

Reputation: 1202

You can use

mysqli_fetch_array()

rather using

mysqli_fetch_assoc()

Upvotes: 3

Related Questions