• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

sql query, problem

emil92b

Intermediate OT User
Joined
Aug 21, 2013
Messages
335
Solutions
13
Reaction score
135
Location
Sweden
im trying to make a query that deletes the players id but also checks that the password of that players account is correct
SQL:
DELETE id FROM players INNER JOIN accounts ON accounts.id = players.account_id WHERE players.id = :playerid AND accounts.password = :password

but i get this error
Code:
Error - SQLSTATE[42S02]: Base table or view not found: 1109 Unknown table 'id' in MULTI DELETE

and if i remove id

i get
Code:
Error - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INNER JOIN accounts ON accounts.id = players.account_id WHERE players.id = ? AND' at line 1
 
Last edited:
Solution
SQL:
DELETE players FROM players INNER JOIN accounts ON accounts.id = players.account_id WHERE players.id = :playerid AND accounts.password = :password

I think this should work.
SQL:
DELETE players FROM players INNER JOIN accounts ON accounts.id = players.account_id WHERE players.id = :playerid AND accounts.password = :password

I think this should work.
 
Solution
Back
Top