PHP array only showing last sql result -


hello hoping can me, when use print_r last result mysqli query, code below.

//fetch data sql results while($row = $rs->fetch_assoc()){ //put results in array $page_query=array($row['name']=>$row['system']); } } 

you overwriting $page_query everytime in loop, change to:

while($row = $rs->fetch_assoc()){ //put results in array   $page_query[] =array($row['name']=>$row['system']); } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -