Hello,
I have been trying to use the php snippet "Display (x) random users with their name and avatar" found here: http://drupal.org/node/29246
I have created a new block and then pasted the php snippet into it.
Here is the site: www.conorin.com/site
I'm rather puzzled that I am getting the following error:
user error: Unknown table 'n' in where clause
query: SELECT * FROM drupal_users u WHERE (n.language ='en' OR n.language = '') ORDER BY RAND() LIMIT 0, 3 in /home/conorin/public_html/site/includes/database.mysql.inc on line 66.
and this is line 66 of database.mysql.inc: trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_ERROR);
...also, when I look at the script below, I can't find the WHERE clause in the php! Any suggestion would be MUCH appreciated!!!!
Thanks, Jason
<?php
/*
* This php snippet loads up a random user object and displays their name and avatar.
* $count controls (x) number of users to display
* $no_avatar controls the path to the default avatar image to display.
*
* tested and works with drupal 4.6.x
*/
$count = 3;
$no_avatar = "misc/no-avatar.png";
$result = db_query_range(db_rewrite_sql("SELECT * FROM {users} u ORDER BY RAND()"), 0, $count);
while ($user_info = db_fetch_object($result)) {
if($user_info->uid){
if($user_info->picture){
print '
picture.'">';