MySQL select query with multiple conditions

前端 未结 5 1350
别跟我提以往
别跟我提以往 2020-12-24 05:17

I have written a MySQL query but it doesn\'t seem to be working, because the result is empty. Is there any mistake in my code?

$result = mysql_query(
     \"         


        
5条回答
  •  无人及你
    2020-12-24 05:39

    Lets suppose there is a table with following describe command for table (hello)- name char(100), id integer, count integer, city char(100).

    we have following basic commands for MySQL -

    select * from hello;
    select name, city from hello;
    etc 
    
    select name from hello where id = 8;
    select id from hello where name = 'GAURAV';
    

    now lets see multiple where condition -

    select name from hello where id = 3 or id = 4 or id = 8 or id = 22;
    
    select name from hello where id =3 and count = 3 city = 'Delhi';
    

    This is how we can use multiple where commands in MySQL.

提交回复
热议问题