Having a touch of trouble with a mysql query :(
Posted: Mon Dec 07, 2009 12:11 am
ok i am sorting out pagination for my members list which only displays email active people... and you can also filter by 1st letter of the username.
when you filter by all or a letter it works fine. but when it comes to numbers, it doesnt filter out those which are and arnt activated by email
here is the code, can anyone point me in the right direction on what to change lol.
Ta x
when you filter by all or a letter it works fine. but when it comes to numbers, it doesnt filter out those which are and arnt activated by email
here is the code, can anyone point me in the right direction on what to change lol.
Code: Select all
if($order == 'num'){
$memberTotal = mysql_num_rows(mysql_query("SELECT id FROM user_list WHERE name_tag = '1' OR name_tag = '2' OR name_tag = '3' OR name_tag = '4' OR name_tag = '5' OR name_tag = '6' OR name_tag = '7' OR name_tag = '8' OR name_tag = '9' OR name_tag = '0' AND email_active = '1'"));
$getList = mysql_query("SELECT id, username FROM user_list WHERE name_tag = '1' OR name_tag = '2' OR name_tag = '3' OR name_tag = '4' OR name_tag = '5' OR name_tag = '6' OR name_tag = '7' OR name_tag = '8' OR name_tag = '9' OR name_tag = '0' AND email_active = '1' ORDER BY id ASC LIMIT $startID, $perPage");
}