I have a problem with a SQL that runs perfectly in phpMyAdmin, but does not rotate passing the query to the database by PHP.
Query copied from phpMyAdmin's SQL field:
SELECT 'idforma_pagamento', 'habilitado', 'descricao',
CASE forma_pagamento.tipo
WHEN 0
THEN 'A PRASO'
WHEN 1
THEN 'A VISTA'
END AS tipo,
CASE forma_pagamento.entrada
WHEN 0
THEN 'SIM'
WHEN 1
THEN 'NÃO'
END AS entrada
FROM forma_pagamento
WHERE 1
Same query passed to $query
variable in PHP:
"SELECT 'idforma_pagamento', 'habilitado', 'descricao',"
."CASE forma_pagamento.tipo"
."WHEN 0"
."THEN 'A PRASO'"
."WHEN 1"
."THEN 'A VISTA'"
."END AS tipo,"
."CASE forma_pagamento.entrada"
."WHEN 0"
."THEN 'SIM'"
."WHEN 1"
."THEN 'NÃO'"
."END AS entrada"
."FROM forma_pagamento"
."WHERE 1";
Someone there can help me