I wan’t to add text “You” Before msg but it getting error. my php code :
($outgoing_id == $row2[‘outgoing_msg_id’]) ? $you = “You: ” : $you = “”;
Advertisement
Answer
i think this error returned due to the nullable of the $row2 this besides the wrong format of the condition as @DamianCabelloJiménez mentioned we can add a little edit to @DamianCabelloJiménez answer to handle the nullable case
$you = (isset($row2['outgoing_msg_id']) && $outgoing_id == $row2['outgoing_msg_id']) ? "You: " : "";