Professional Web Applications Themes

Check for statement - MySQL

If I have a MySQL-query that seems like this: SELECT `dom`.`id`, `sam`.`id`, `fld`.`id` FROM `dom`, `fld`, `sam` WHERE `dom`.`id`='1', `sam`.`id`='6', `fld`.`id`='4'; Can I then count, if there is 3 returning values, or does anybody have a better idea to check, if there are 3 returning values?...

  1. #1

    Default Check for statement

    If I have a MySQL-query that seems like this:
    SELECT `dom`.`id`, `sam`.`id`, `fld`.`id` FROM `dom`, `fld`, `sam`
    WHERE `dom`.`id`='1', `sam`.`id`='6', `fld`.`id`='4';

    Can I then count, if there is 3 returning values, or does anybody have
    a better idea to check, if there are 3 returning values?

    The87Boy Guest

  2. #2

    Default Check for statement

    If I have a MySQL-query that seems like this:
    SELECT `dom`.`id`, `sam`.`id`, `fld`.`id` FROM `dom`, `fld`, `sam`
    WHERE `dom`.`id`='1', `sam`.`id`='6', `fld`.`id`='4';

    Can I then count, if there is 3 returning values, or does anybody have
    a better idea to check, if there are 3 returning values?

    The87Boy Guest

  3. #3

    Default Re: Check for statement

    >If I have a MySQL-query that seems like this: 

    This query is wierd. You're doing a 3-way join with no relationship
    between the tables?
     

    What interface are you using to submit queries (C, PHP, the mysql
    command-line utility, ODBC)?

    mysql_num_rows() (C, PHP interfaces) will tell you how many rows
    you got back. I don't see how you can possibly not get 3 values
    back in each row assuming you get rows back at all. NULL is a
    value. If you need to tell whether you got a NULL, that depends
    on the interface.

    Gordon Guest

  4. #4

    Default Re: Check for statement

    On 3 Mar., 18:54, org (Gordon Burditt) wrote: 
    >
    > This query is wierd. You're doing a 3-way join with no relationship
    > between the tables?[/ref]

    What do you mean with relationship between tables?
     
    >
    > What interface are you using to submit queries (C, PHP, the mysql
    > command-line utility, ODBC)?
    >
    > mysql_num_rows() (C, PHP interfaces) will tell you how many rows
    > you got back. I don't see how you can possibly not get 3 values
    > back in each row assuming you get rows back at all. NULL is a
    > value. If you need to tell whether you got a NULL, that depends
    > on the interface.[/ref]

    It is on command-line
    NULL and an empty row should count

    The87Boy Guest

  5. #5

    Default Re: Check for statement

    On 4 Mar., 21:22, "The87Boy" <com> wrote: [/ref]

    >
    > What do you mean with relationship between tables?
    > [/ref]


    >
    > It is on command-line
    > NULL and an empty row should count[/ref]

    Oh, I mean shouldn't count as rows

    The87Boy Guest

Similar Threads

  1. Spell Check and Grammer Check
    By Raj in forum ASP
    Replies: 1
    Last Post: July 1st, 05:05 PM
  2. Turning off Check in / Check out feature
    By SweetEngineer in forum Macromedia Contribute General Discussion
    Replies: 2
    Last Post: January 2nd, 07:05 PM
  3. Check to see if Check Boxes are Checked
    By Lyn in forum ASP Database
    Replies: 2
    Last Post: December 15th, 06:00 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139