HI im getting the following error
Warning: Invalid argument supplied for foreach() in /home/jktempla/public_html/includes/class-query.php on line 106
in the following bit of coding can anyone see whats happening

public function do_user_directory() {


    $users = $this->load_all_user_objects();

                    foreach ( $users as $user ) { ?> <div class="directory_item"> <h3><a href="/social/profile-view.php?uid=<?php echo $user->ID; ?>"><?php echo $user->user_nicename; ?></a></h3> <p><?php echo $user->user_email; ?></p> </div> <?php
                    }
                }

any help would be much appreicated jan :)

The foreach() construct expects something "iterable" -- an array or an object. That error basically indicates that $this->load_all_user_objects() is not returning something iterable. So you need to focus on the "load_all_user_objects()" method and figure out why it is not returning the expected results.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.