change $wpdb to global scope for use in widget?
Hi, here is the page:
the area in question is the error in the second SELECT in the right column. The following PHP is in the HEAD:
$authorsArchives = $wpdb->get_results("SELECT * FROM $wpdb->users");
and then the following PHP is used in a King Text widget:
<?php foreach ($authorsArchives as $authorArchiveLink): ?>
<option value="<?php echo $authorArchiveLink->user_nicename; ?>"><?php echo $authorArchiveLink->display_name; ?></option>
<?php endforeach; ?>
and you see what that does on the above link. I’m guessing it has something to do with the scope of $wpdb but I don’t really understand how to fix that. Can anybody help?
- The topic ‘change $wpdb to global scope for use in widget?’ is closed to new replies.