I'm not quite sure if I am doing it right:

PHP Code:
    sql "UPDATE players SET nick='" mysql_real_escape_string(level.mysqlself.name) + "' WHERE guid='" self getGuid() + "'"