Sir I have these codes

<?php
$result = array( 
    array('date'=>'2017-04-17','voucher'=>2,'code'=>'1401001','party'=>'Michael','d1'=>'Payment of services','dr_amount'=>500), 
    array('date'=>'2017-04-18','voucher'=>1,'code'=>'1401002','party'=>'Eric','d1'=>'Payment of goods','dr_amount'=>1000), 
); 

while ($row=mysqli_fetch_array($result)){
    echo $row['party'];
}
?>

the codes display this error message

E_WARNING : type 2 -- mysqli_fetch_array() expects parameter 1 to be mysqli_result, array given -- at line 7

What I am doing wrong?

Please hep

Member Avatar for diafol

You are passing an array not a mysqli_result (as described in your error message) to the mysqli_fetch_array() function. Read th php manual on this function. You CANNOT use bog standard arrays with this function. Use foreach($result as $row){ ... }

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.