Im sure this has been answered, so if you have a relevent link please let me know.
I need to pass a condition into an array. (if this is a bad idea also please offer another solution im all ears).
PHP
$solUpdate = "";
if($info[$i]->shortSubject == $el && $info[$i]->id != $tid){
$solStat = $wpdb->get_content('is_ticket','ticket_id ='.$tid,'solarStatus');
$check = solarCurl($info[$i]->id,"Tickets",false);
$check = json_decode($check);
if($solStat != $st){
$solUpdate = ("solarStatus"=>$st);
}
$wpdb->update('is_ticket', array('solarID'=>$info[$i]->id,$solUpdate), array('parent_ticket'=>$tid, 'solarTType'=>$check->problemtype->id));
}
Here is what I am trying to accomplish,
If $solStat != $st, then I want to update that Row with $st, but.... $st may not always be different, so there is no actual update to do, BUT... I dont want to write an else to my if, I think thats terrible code practice. Im sure this is easy, and I have looked to find how to do this. Thank you for your help.