• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

sql query, problem

  • Thread starter Thread starter emil92b
  • Start date Start date
E

emil92b

Guest
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 by a moderator:
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