Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- $query = $dbh->query("SELECT name, city FROM schools WHERE 1 GROUP BY name,
- city");
- $query->setFetchMode(PDO::FETCH_ASSOC); //THIS IS LINE 21 error refers to
- $iterator = new IteratorIterator($query);
- foreach ($iterator as $row) {
- if (empty($row['name']) == false && !in_array($row['name'], $name_list))
- $name_list[] = $row['name'];
- if (empty($row['city']) == false && !in_array($row['city'], $city_list))
- $city_list[] = $row['city'];
- }
Add Comment
Please, Sign In to add comment