Add select friends function and change the login table in sql