Jump to content

Search help


MIGhunter

Recommended Posts

I found a tutorial on a search function.  I ran through the tutorial and then altered it for what I was doing.  Everything works as suspected except if I do a search with only numbers, it says to enter a search query.  How can I alter it so it works with numbers only?  i.e. j1111 will work but 1111 will not.

 

code:

http://pastebin.com/zYDW3Sgb

 

example testing site:

http://migcfdesign.com/CodeTesting/AJ/search_byalltablenum.php?go

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

A quick look at that pastebin showed me that the code you used was originally intended as a user search of some kind.

 

If you notice the "preg_match" function, it is checking the input from the form (via POST) that it contains only a-z and A-Z characters. You just need to add 0-9 also.

 

-cb-

Link to comment
https://forums.phpfreaks.com/topic/207389-search-help/#findComment-1084259
Share on other sites

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.