![]() |
Memberlist Search
Can anyone please tell me how to make the following code to a partial serach for a member instead of having to have the full member name first?
Code:
if ($action=="quickfind") { |
instead of username='".addslashes($membername)."'
use username LIKE '%".addslashes($membername)."%' |
Ok, that worked, thank you. Now, how can I pull out the full username from the search and display it in the "redirect_memberfound" template. If I use "$membername" like it is now, it pulls out what was in the search string (like boofos ba) instead of the full username. Also, is there a way to have it bring up a listing of just the names found in the search so the user can pick from them?
Quote:
|
you have to construct a while loop to get all usernames...
to get the correct username instead of $membername use $usernamecheck[username] |
Ok, but will that do an excessive amount of queries then?
I tried using $usernamecheck[username] and all I get is a blank spot where the name should be. :) Quote:
|
no, no great ammount of queries, just one query and then just fetcharrays ;)
oh sorry, you must include ,username in the query: SELECT userid,username FROM... |
Thanks, Stefan, now it brings up the username ok.
How do I get it to bring up the user alphabetically instead of going by the userid? Right now a user with a Marj in the name comes up before an Marc when I type Mar. It is going by when they joined right now. :) Quote:
|
add a "ORDER BY username" into the query
|
I take it from my DB error, I put it in the wrong place? :)
PHP Code:
Quote:
|
Code:
SELECT userid,username FROM user WHERE username LIKE '%".addslashes(htmlspecialchars($membername))."%' ORDER BY username |
All times are GMT. The time now is 02:42 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|