Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unanswered: int in where clause

    in mysql i have a query as ... where num='355'. but the results for 355 are also returned if i have where num='355+(*';

    here num is a int field.

    i want it to return 0 records in that case. how do i do that?

  2. #2
    Join Date
    Jul 2004
    Dundee, Scotland
    Interesting... I wouldn't have expected MySQL to work that way. Here are a few options:

    Try casting it as an 'integer' if using MySQL 4.0.2:

    Use PHP to validate the value before doing the database query:

    Use a MySQL/REGEXP query to validate the value first:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts