Bluehost.com Web Hosting $6.95

Check for statement

This is a discussion on Check for statement within the MySQL Database forums, part of the Database Forums category; If I have a MySQL-query that seems like this: SELECT `dom`.`id`, `sam`.`id`, `fld`.`id` FROM `dom`, `fld`, `...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-03-2007
The87Boy
 
Posts: n/a
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?

Reply With Quote
  #2 (permalink)  
Old 03-03-2007
Gordon Burditt
 
Posts: n/a
Default Re: 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';


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

>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?


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.

Reply With Quote
  #3 (permalink)  
Old 03-04-2007
The87Boy
 
Posts: n/a
Default Re: Check for statement

On 3 Mar., 18:54, gordonb.3g...@burditt.org (Gordon Burditt) wrote:
> >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';

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


What do you mean with relationship between tables?

> >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?

>
> 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.


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

Reply With Quote
  #4 (permalink)  
Old 03-04-2007
The87Boy
 
Posts: n/a
Default Re: Check for statement

On 4 Mar., 21:22, "The87Boy" <the87...@gmail.com> wrote:
> On 3 Mar., 18:54, gordonb.3g...@burditt.org (Gordon Burditt) wrote:
>
> > >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';

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

>
> What do you mean with relationship between tables?
>
> > >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?

>
> > 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.

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


Oh, I mean shouldn't count as rows

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:19 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0