Show results in a select from the database [closed]

0

I want to pull data from a database but only show fields that are equal to 1 and its id equal to 7 say in an html select.

Let me explain myself better: If your id is equal to 7 but your "home" field is equal to one, I do not want to show "home" in the select

    
asked by Sergio 13.01.2017 в 00:19
source

1 answer

1

It is not very clear what you need to do, but from what I understood, I hope this helps:

select * from table_name where id = 1 and casa != 7;

where != is different from the given value.

On the other hand if you need different values:

select * from table_name where id = 1 and casa not in (7, 8, 9, ..., n);
    
answered by 13.01.2017 / 00:33
source