Using AND/OR in if else PHP statement

后端 未结 10 1928
梦如初夏
梦如初夏 2020-12-12 19:16

How do you use \'AND/OR\' in an if else PHP statement? Would it be:

1) AND

if ($status = \'clear\' AND $pRent == 0) {
    mysql_query(\"UPDATE rent 
         


        
10条回答
  •  情话喂你
    2020-12-12 20:17

    You have 2 issues here.

    1. use == for comparison. You've used = which is for assignment.

    2. use && for "and" and || for "or". and and or will work but they are unconventional.

提交回复
热议问题