Jump to content

Recommended Posts

Hi, i've never created a search in php so i'm not exactly sure on the method you can use do create a search, basically i have created an admin panel and it has a list of users but if there are too many users i will need to create a search.

 

Please can someone tell me how i can do this?

 

Thanks in advance! :)

Link to comment
https://forums.phpfreaks.com/topic/296346-search-users/
Share on other sites

Depends on what you need to search for, but let's say you want to search for the users last name.

 

Create a form with an input for the last name. When submitting the form, just do a search for the last name in the db using WHERE lastname = 'lastname_from_form' to get an exact match, or WHERE lastname LIKE 'lastname_from_form%' to get all that start with lastname_from_form (the % at the end is a wildcard).

 

Then display the list of matched users

Edited by CroNiX
Link to comment
https://forums.phpfreaks.com/topic/296346-search-users/#findComment-1511997
Share on other sites

Depends on what you need to search for, but let's say you want to search for the users last name.

 

Create a form with an input for the last name. When submitting the form, just do a search for the last name in the db using WHERE lastname = 'lastname_from_form' to get an exact match, or WHERE lastname LIKE 'lastname_from_form%' to get all that start with lastname_from_form (the % at the end is a wildcard).

 

Then display the list of matched users

 

Thanks, CroNiX i will try this! :)

Link to comment
https://forums.phpfreaks.com/topic/296346-search-users/#findComment-1511999
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.