Using JOINS for two tables with conditions

Yes it was a mistake (now fixed), and the IF is essentially a tertiary operator, but it uses commas instead of the question mark and the colon. It works out to:

IF(condition, return this if true, return this if false)

So your output would be

0 = {
'postid' => 3,
'commentername' => 'jerry',
'commenterid' => 15,
'comment' => 'i have seen you',
'date' => '2021-08-16',
'userStatus' => 'commenter is online'
}

1 = {
'postid' => 3,
'commentername' => 'mike',
'commenterid' => 2,
'comment' => 'i know am not logged in',
'date' => '2021-08-16',
'userStatus' => 'commenter is offline'
}
1 Like