MIGhunter Posted July 11, 2010 Share Posted July 11, 2010 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 More sharing options...
ChemicalBliss Posted July 11, 2010 Share Posted July 11, 2010 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 More sharing options...
MIGhunter Posted July 11, 2010 Author Share Posted July 11, 2010 That was it. Thank you for your help. Anyone know of a good jQuery or Prototype autocomplete tutorial that I can implement. It's a little confusing on how to use autocomplete with php and a database. Link to comment https://forums.phpfreaks.com/topic/207389-search-help/#findComment-1084292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.