Jump to content

Help creating if with 2 or more conditions


czs

Recommended Posts

Hi all

 

I'm trying to make an if condition based off more than one criteria.  Here is the code I have now but it doesn't work.  My guess is the word AND isn't the right way to do this.

 


if ($row_rsM1p['Match1'] !== '0' AND $row_rsM1p['Match2'] !== '0' AND $row_rsM1p['Match3'] == '0') {
//do stuff

}

 

Thanks

Link to comment
Share on other sites

 

Thank you for helping but that didn't work.  I think there might be a fundamental problem with my if statement.

 

I want it to do the stuff within the statement if the  field "Match1" in the recordset  "rsM1p"  contains just the number 0  .  Is  writing  == '0'    the way I did, the right way to do this?

Link to comment
Share on other sites

Update:

 

I replaced '0'  with a hidden field name that I create  'Post0' with a value of 0  and it still didn't work. 

 

Now I'm starting to think that the way I'm referencing the field in the recordset is wrong.

 

Is

 

<?php
if ($row_rsM1p['Match1'] != 'Post0')
?> 

 

the right way to say if field match1 in recordset rsM1p  does not equal the value in the hidden field 'Post0'    ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.