Click here to Skip to main content
15,886,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Fatal error: Uncaught exception 'Exception' with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'To ON To.Spieler_Sid=Sp.SId' at line 1' in

PHP
FROM Spieler Sp INNER JOIN Vereine Ve ON Sp.Vereine_VId=Ve.VId INNER JOIN Tore To ON To.Spieler_Sid=Sp.SId

but I don´t know where´s the mistake :SS
Posted
Updated 22-Dec-13 6:56am
v2
Comments
Er. Tushar Srivastava 22-Dec-13 13:09pm    
There is a Space between Vereine and Ve ... Is that correct ? :)

1 solution

You use reserved word 'TO' as table alias without quoting it.
You should quote it or replace by something else.
Please refer these links for details:
8.2 Database, Table, Index, Column, and Alias Names[^]
9.3. Reserved Words[^]
 
Share this answer
 
v2
Comments
Chi Ller 22-Dec-13 13:34pm    
Thanks a lot and espacially for the link with Reserved Words :D Should have a look to it
skydger 22-Dec-13 13:52pm    
You're welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900