Jump to content

url query for two values


wkilc

Recommended Posts

Hi,

 

I've can use the following URL to filter the query below:

 

www.mysite.com?levels=PreK

...this will show me alll the PreK members.

www.mysite.com?levels=Elem

...this will show me all the Elem members.

 

How do I filter it to show both me BOTH the PreK and Elem members?

 

Do I need to change the query?

 

        WHERE ((user_info.Type LIKE '$Type%')
                and ((user_info.snr_First LIKE '%$name%')
                or (user_info.snr_Last LIKE '%$name%'))
     		and (user_info.snr_Home_phone LIKE '$snr_Home_phone%')
   		and (user_info.snre_eMail LIKE '$snre_eMail%')
   		and ((user_info.PreK LIKE '$levels%')
	or (user_info.Elem LIKE '$levels%')
	or (user_info.MS LIKE '$levels%')
	or (user_info.HS LIKE '$levels%')
	or (user_info.College LIKE '$levels%')
        or (user_info.Admin LIKE '$levels%')
                or (user_info.Prvt LIKE '$levels%')))
        	ORDER BY user_info.$sort LIMIT $eu, $limit ";
$result = mysql_query($query);

 

Thanks.

 

~Wayne

Link to comment
https://forums.phpfreaks.com/topic/210974-url-query-for-two-values/
Share on other sites

Something like this?  (I say like this... because I've done something wrong ...and this gives me an error.)

 

        WHERE ((user_info.Type LIKE '$Type%')
                and ((user_info.snr_First LIKE '%$name%')
                or (user_info.snr_Last LIKE '%$name%'))
     		and (user_info.snr_Home_phone LIKE '$snr_Home_phone%')
   		and (user_info.snre_eMail LIKE '$snre_eMail%')
   		and ((user_info.PreK LIKE '$levels%')
	or (user_info.Elem LIKE '$levels%')
	or (user_info.MS LIKE '$levels%')
	or (user_info.HS LIKE '$levels%')
	or (user_info.College LIKE '$levels%')
        or (user_info.Admin LIKE '$levels%')
                or (user_info.Prvt LIKE '$levels%'))
                and (user_info.PreK AND user_info.Elem LIKE '$primary%'))
        	ORDER BY user_info.$sort LIMIT $eu, $limit ";
$result = mysql_query($query);

 

Thanks.

 

~Wayne

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.