Results 1 to 3 of 3

Thread: Syntax problem

  1. #1
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    57

    Unanswered: Syntax problem

    How can I write the following query
    Code:
    $query="SELECT * FROM $table WHERE region > 30";
    $query_res=mysql_query($query) or die(mysql_error());
    $countlisted=mysql_num_rows($query_res);
    print "&total=" .$countlisted;
    to select all the rows which number is greater than 30 but discard the rows which content is 98 ?

    Many thanks in advance for your help !
    Best regards.

    Gerard
    Last edited by Germaris; 12-14-06 at 16:08.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry do you mean where the number is in range 31..97
    "SELECT * FROM $table WHERE region > 30 and region<98"

    OR where its greater than 30 but not equal 98
    "SELECT * FROM $table WHERE region > 30 and region != 98"
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    57
    Quote Originally Posted by healdem
    where its greater than 30 but not equal 98
    "SELECT * FROM $table WHERE region > 30 and region != 98"
    This is what I was looking for !!!
    Thank you ! Thank you ! Thank you !

    :-)

    Gerard

Posting Permissions

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