I made a little webapp maded with PHP+HTML5+JS, the app work flawless on my local webserver (on my laptop), I'm using XAMPP v3.2.2 with Server version: 10.1.9-MariaDB mariadb.org binary distribution.
I uploaded all files and imported the database to a webserver, and I get an weird error in one PHP file that exec a MySQL query to the database.
I got the query and manually exec on my local phpMyAdmin and works with no errors, but in the webserver there is a syntax error :(
This is an example of the query:
SELECT DISTINCT 100 AS cyear, DATE_FORMAT( personas.fecha, '%d/%m/%Y' ) AS fecha, 1 AS numb, personas
.id_persona, personas.distancia, (
personas.rating - (
SELECT valor.valor FROM valor WHERE valor.valor=1 AND valor.distancia=(
SELECT personas.distancia WHERE personas.id_persona=1))) AS calc, (personas.rating +
personas.rating - (
SELECT valor.valor FROM valor WHERE valor.valor=1 AND valor.distancia=(
SELECT personas.distancia WHERE personas.id_persona=1))) As clase, personas.rating
FROM personas, valor WHERE personas.id_persona=1 AND valor.valor=1
The Error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
What's is wrong? I have hours trying to find out, maybe I use some deprecated functions? Thanks for reading and please forgive that bad english.