The first attempt doesn't work because if it WOULD work, you could never write the word IPADDRESS in a string without having it replaced by it's definition.
What might work but of which I'm not sure is using {IPADDRESS} instead of just IPADDRESS.
And in the second attempt you didn't get the quotes at the end right.
$update = mysql_query("UPDATE login_errors SET tries = '$addtry' WHERE ip_address = '".IPADDRESS."' ") or die(mysql_error());
1. The :: means that you're accessing the member function of a class definition without an initialized class (so this is not definied)
2. I've never seen session_set_save_handler before but from what I just read it appears that it enables you to define your own way of saving a user's session data, so you could save it in a database but not on the client's machine.