Jump to content


Photo

php mysql search problem


  • Please log in to reply
2 replies to this topic

#1 goatboy

goatboy
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 05 October 2005 - 08:47 PM

i made a search to search order numbers, if you input numbers it works correctly even if its an order number that doesn't exist it just tells you that

but i tested if someone where to type text, and i get a mysql error, shouldn't it do the same thing as if it were an order number that didn't exsit?



#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 05 October 2005 - 09:13 PM

numbers do not have to be quoted; text does. i would use some validation, such as is_numeric, before passing the data to mysql.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 goatboy

goatboy
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 05 October 2005 - 09:35 PM

thanks, that solves my problem




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users