08.03.2016, 12:22
Hi
A long time ago i made a mistake by handling house table by playername instead of userid.
Its working, but i want the house table to be dealt with by userid instead.
The problem is that there is alot of houses in the table already and i just added userid.houses field now.
So is it possible to make a query that gets username.houses -> SELECT userid.useraccounts -> UPDATE userid.houses to add the correct value from userid.useraccounts to userid.houses ?
I know this can be done with pawn by looping houses -> SELECT userid FROM useraccounts WHERE username = 'HouseOwner' -> then send a new query to UPDATE userid in houses. But i want to know if there is a way this can be done in 1 single query in phpmyadmin.
Thanks in advance.
A long time ago i made a mistake by handling house table by playername instead of userid.
Its working, but i want the house table to be dealt with by userid instead.
The problem is that there is alot of houses in the table already and i just added userid.houses field now.
Quote:
Table: houses Fields: userid, username .. |
Quote:
Table: useraccounts Fields: userid, username .. |
I know this can be done with pawn by looping houses -> SELECT userid FROM useraccounts WHERE username = 'HouseOwner' -> then send a new query to UPDATE userid in houses. But i want to know if there is a way this can be done in 1 single query in phpmyadmin.
Thanks in advance.