mysql - PHP mysqli_fetch_assoc stored into an array -


i having troubles pulling row sql query , storing array. here code.

$sql = "select water, importdate         customer_table         customer_number = '" . $custnum . "';";         $result_of_login_check = $this->db_connection->query($sql);         echo $sql . "<br>";         $result = mysqli_query($this->db_connection,$sql);          // set array         $array = array();          // through query         while($row = mysqli_fetch_assoc($result)){          // add each row returned array         $array[] = $row;         }         print_r($array); 

this output looks when print array,

array (      [0] => array (          [water] => 23          [importdate] => 2014-03-29      )      [1] => array (          [water] => 33          [importdate] => 2015-02-22 )      ) 

while storing, stuck @ trying figure out how copy each row array looks this,

array (      [water] => 23      [importdate] => 2014-03-29 )  array (      [water] => 33      [importdate] => 2015-02-22 ) 

which each row stored in $row.

what going need pull list of bill amount , dates same customer database , display each month date. showing current months bill.

thanks help!

who containing objects when say?

array (      [water] => 23      [importdate] => 2014-03-29 )  array (      [water] => 33      [importdate] => 2015-02-22 ) 

nothing.. need have array containing arrays, or need have multiple arrays indexed somewhere, array arrays. nothing wrong format..

why need format specifically? doesn't make sense..


Popular posts from this blog