The column called ‘ref’ will need to be unique. If it has a dupe, then it will complete the second part of the statement.
$results = $mysqli->query("INSERT INTO client_login (fname, sname, ref)
            VALUES ('Mike', 'Belmond','T99')
ON DUPLICATE KEY UPDATE fname='Mike', sname='Belmond',ref='T100'");
            if($results){
                print 'Success! record updated / deleted';
            }else{
                print 'Error : ('. $mysqli->errno .') '. $mysqli->error;
            }
 
								 
								 
															











