0

anyone can help me how to make coding like below.

IF husband(L3) does not have a son (L1)
AND do not have a daughter (P1)
AND do not have the grandson of the son (L4)
AND do not have a granddaughter from son (P4)
THEN breakdown for men is 1 / 2

3
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by diafol
1

Ok so however you set your variables up, say using an array.

$husband['son'] = 0; //0=no 1=yes
$husband['daughter'] = 0;
$husband['grandson'] = 0;
$husband['granddaughter'] = 0;

// the php statement below would achieve what you are looking for I believe

if (($husband['son'] == 0) && ($husband['daughter'] == 0) && ($husband['grandson'] == 0) && ($husband['granddaughter'] == 0)) {
$men== '1/2';
} else {
//has son, daughter, grandson, or granddaughter
}

You could also use case function from php or set it up using normal variables but thats the jest of it.

Just use if statement and && or you can use || (meaning 'or') delimiters for your statement.

if (this==this) && (that==that) {
//then do this
} else if (these==these) {
//do these
} else {
// do it here
}
0

How to get sql statement from a database like the problem

0

Husband IF (L3) does not have a son (L1)
AND do not have a daughter (P1)
AND do not have the grandson of the son (L4)
AND do not have a granddaughter from son (P4)
THEN breakdown for men is 1 / 2

Daughter IF 1 (P1) no son (L1)
THEN for a fraction of its women is 1 / 2

Mother IF (P2) there is no son (L1)
AND there are no girls (P1)
AND there are no male descendants of the sons (L4)
AND no granddaughter of a son (P4)
AND no 2/lebih whether male or female siblings / half brother / sister mother or a mixture of all three types of relatives are
THEN breakdown for Mom is 1 / 3

0

Have you looked at the MySQL online manual?

pHp would probably be quicker for conditional processing. You just enter the result in your SQL.

0

> not yet....

I don't wish to sound rude, but don't you think you should research your issue before asking contributors on a forum to do your work for you? Please read the forum guidelines.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.