What I am trying to do here is write a code to update my database automatically; for those derived attributes. Here is the part of the code where I try to grab all the rows in an array:
include("dbConnect.php");
$results = $mysqli->query("SELECT * from nw_order;");
if($results)
foreach($results as $hgh)
$resultArray[] = $results->fetch_row();
else
die("Query failed");
foreach($resultArray as $row) {
foreach($row as $field)
print $field." ";
print "<br>";
}
The foreach grab only even numbered rows for some reason. Also, trying to substitute foreach with while gives me memory shortage error. I am so tired I will check in tomorrow. If you can help me out that will be awesome.
$resultsvariable to fill up the$resultArrayvariable to loop through it again?foreach(...) { $resultArray[] = $hgh; }