i would try this:

 $sql = "SELECT DISTINCT users.names
        FROM  users, selection
        Where  users.name = selection.name   and   selection.setting = 'on'
        ";
because you joining two tables and you get as many results per users.name =
selection.name as entries in bouth tables per user. The DISTINCTROW could solve
the problem. However i don't know the number of records per user excists in the
tables, let assume u have not relaid on relational database rules and users are
not unique in one of the tables the following has to be done

 $sql = "SELECT DISTINCT users.names
        FROM  users, selection
        Where  users.name = selection.name   and   selection.setting = 'on'
        GROUP BY users.name";


Jeremy Morano schrieb:

> Hi,
>
> I wondering if it was possible to use limit on part of a query and not all.
>
> this is my query which works the way it should.
>
> $sql = "SELECT users.names
>         FROM  users, selection
>         Where  users.name = selection.name   and   setting = 'on' limit 1
>         ";
>
> What I would like to do is put a limit of 1 to only this part -----> setting
> = 'on' limit 1 <--------------- and not on the rest.
>
> You see, there are many users.name that have a setting = 'on'............I
> want, ALL those names , ONLY once..
>
> How do I do this?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to