Hello.
i'm trying to build a search function in the userlist created by usermgr.php
but i looks like i cant use WHERE user_name LIKE or WHERE u.user_list LIKE
here is my code i use
$search = $_GET['search'];
$sql = "SELECT user_id, user_name, UNIX_TIMESTAMP(user_regdate) as user_regdate, UNIX_TIMESTAMP(user_lastvisit) as user_lastvisit, user_active, ".
"COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_name, group_quota ".
"FROM {$CONFIG['TABLE_USERS']} AS u ".
"WHERE u.user_name LIKE " . $search . " ".
"INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id ".
"LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.owner_id = u.user_id ".
"GROUP BY user_id ".
"ORDER BY " . $sort_codes[$sort] . " ".
"LIMIT $lower_limit, $user_per_page;";
i want to use %$search% but i first i have to make this one work
there error is like this
While executing query "SELECT user_id, user_name, UNIX_TIMESTAMP(user_regdate) as user_regdate, UNIX_TIMESTAMP(user_lastvisit) as user_lastvisit, user_active, COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_name, group_quota FROM cpg11d_users AS u WHERE u.user_name LIKE 'terrorhawk' INNER JOIN cpg11d_usergroups AS g ON user_group = group_id LEFT JOIN cpg11d_pictures AS p ON p.owner_id = u.user_id GROUP BY user_id ORDER BY user_regdate DESC LIMIT 0, 25;" on 0
mySQL 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 'INNER JOIN cpg11d_usergroups AS g ON user_group = group_id LEFT
it keeps getting error in INNER JOIN
can someone please help me and tell me how to add this line in the sql query ?
couse a search function in a user list with 1500+ users would be great
and i'm almost there
Grz