OK, so, this may seem like a dumb question. I've looked through the other threads with this thing and I'm not finding QUITE what I'm looking for.
I get this error:
Warning: Invalid argument supplied for foreach() in entry.php on line 118
line 118 is the foreach that I'm using here:
<select id="Location" name="Location" class="text">
<option selected="selected"> - Choose Location - </option>
<?php
$locations = getLocationList();//this returns an array from separate function
foreach($locations as $location) {//<-Line 118
echo "<option value=". $location['locationID'] .">".$location['locationName']."</option> ";
}
?>
</select>
It's not populating, it's only throwing the error. Thoughts?
OK EDIT This is how I'm pulling the data in a separate function:
function getLocationList()
{
$mydb = new myDBC();//<-this calls my secure connection class
$table = "LocationTable";
$sql = "SELECT `locationID`, `locationName` FROM " .$table;
$rez = $mydb->runQuery($sql);//<-this connects runs my query
if(isset($rez))
{
$newRow = mysqli_fetch_array($rez);//<-is this not returning an array?
return $newRow;
}
}