What could this be?

Started by smacktalk, October 29, 2004, 01:09:50 AM

Previous topic - Next topic

smacktalk

When I click on the members list:

I get this:

Database Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '!= 0
ORDER BY mem.realName ASC
LIMIT 0, 40' at line 9
File: /***/***/***/forum/Sources/Memberlist.php
Line: 257

[Unknown]

Can you give me lines 240 to 260 of Memberlist.php?

-[Unknown]

smacktalk


'down' => 'mem.posts DESC',
'up' => 'mem.posts ASC'
)
);

// Select the members from the database.
$request = db_query("
SELECT
mem.memberName, mem.realName, mem.websiteTitle, mem.websiteUrl, mem.posts,
mem.ID_GROUP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.emailAddress,
mem.hideEmail, mem.ID_MEMBER, IFNULL(lo.logTime, 0) AS isOnline,
IFNULL(mg.groupName, '') AS groupName, mem.showOnline, mem.dateRegistered
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE $is_activated != 0
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);

printMemberListRows($request);
}

[Unknown]

Replace:

WHERE $is_activated != 0

With:

WHERE is_activated != 0

-[Unknown]

smacktalk

Quote from: [Unknown] on October 29, 2004, 03:49:46 AM
Replace:

WHERE $is_activated != 0

With:

WHERE is_activated != 0

-[Unknown]


Worked, many thanks. :)

Metho

Gah, how'd that typo get in there...pah. Anyhow, is updated on the thread in tips and tricks as well. Sorry about that, Smacktalk.

- Methonis
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

smacktalk

Quote from: Metho on October 29, 2004, 03:52:36 PM
Gah, how'd that typo get in there...pah. Anyhow, is updated on the thread in tips and tricks as well. Sorry about that, Smacktalk.

- Methonis

Question:

Why does my memberlist.php on my other forum have different code?


// Select the members from the database.
$request = db_query("
SELECT
mem.memberName, mem.realName, mem.websiteTitle, mem.websiteUrl, mem.posts,
mem.ID_GROUP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.emailAddress,
mem.hideEmail, mem.ID_MEMBER, IFNULL(lo.logTime, 0) AS isOnline,
IFNULL(mg.groupName, '') AS groupName, mem.showOnline, mem.dateRegistered
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);

printMemberListRows($request);
}

[Unknown]

Because you changed the code according to Methonis' tips?

-[Unknown]

smacktalk


smacktalk

Quote from: [Unknown] on October 29, 2004, 10:57:38 PM
Because you changed the code according to Methonis' tips?

-[Unknown]

you beat me to it

Advertisement: