Jump to content

problem i cant get my head around


mforan

Recommended Posts

how does one, make an IF ask an OR (||)??

 

god this is really hard to explain, basically im comparing 2 things, but i only want it to compare the second thing if the first thing is not allowed.

 

in example:

 

2 users relating to 1 primary key. both users must be able to view it and their friends (some friends are with the primary key, some are not). but no one else lol.

 

so basically, 2 groups. 1 piece of news, both accessable to the people the news happened on + the 2 groups, but no other groups.

 

which is why i ask, is it possible to only do an OR|| if the previous value is false.

Link to comment
https://forums.phpfreaks.com/topic/129856-problem-i-cant-get-my-head-around/
Share on other sites

Not 100% on what you are asking here but:

 

to use an OR in an IF statement -> if($check==1 || $test==2)

 

this means that the statement will execute if either $check = 1 OR $test = 2 meaning that only 1 condition must be met.

 

to use an AND in an IF statement  -> if($check==1 && $test==2)

 

this means that both conditions must be met for the statement to be executed

 

I THINK what you want is some thing like this -> if($check != 1 && $test==2)

 

I THINK...

;D

 

ive made it now so that:

<?php

if ((12 = 12) || (13 = 13)) {

 

?>

page data

 

<? } else { echo "error"

 

this works, as everyone in both groups can read it, what i was ttrying to do was acheve the same thing without an else. lol.

 

is that even possible? lmfao!?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.