mysql - Array to list/or other array in php -
i need sql queries php.
here php code:
$sql = "select * datab (`datestamp` between '$date' , '$date') , (`timestamp` between '08:00:01' , '20:00:00')"; $result = $conn->query($sql); while($list = mysqli_fetch_array($result)) { //echo "$list[0]</br>"; echo "$list[1]</br>"; //this column mysql corresponding temperatures //echo "$list[2]</br>"; //this column mysql corresponding other entries (humidity) //echo "$list[3]</br>"; // echo "$list[4]</br>"; // echo "$list[5]</br>"; //echo "$list[6]</br>"; // echo "$list[7]</br>"; }
so, need access each temperature array or list element , don't know how it. think solution add each $list[1] element array inside while.
basicaly want access element temp[2] (or smth that) second element printed $list[1].
can me?
create array temperature:
$temperature = array(); while($list = mysqli_fetch_array($result)) { $temperature[] = $list[1]; // able acess temperature array anywhere outside loop }
Comments
Post a Comment