How to check WHERE clause with apostrophe in a DELETE operation?

0

I need to delete a record, but in the WHERE clause one of the data has an apostrophe. How can I check this information, because it is obvious that it will give error.

DELETE FROM IES WHERE IDENTIFICACAO ='456' AND ESTADO='SP' AND MUNICIPIO='SAO PAULO' 
AND NOME_IES='UNISANT'ANNA' AND CURSO='PEDAGOGIA' AND TURNO='Noite' AND 
MODALIDADE='Presencial' AND TELEFONE1='1121758000' AND ATENDENTE='2' AND STATUS=0;

Remembering that I tried using quotes, and it still was not.

Could you help me?

    
asked by anonymous 07.08.2014 / 22:51

2 answers

5

If you use two apostrophes ( '' ), you should resolve. But I think you really should be parameterizing your query , and this character would be no problem.

    
07.08.2014 / 23:17
0

try with counter before apostrofo \'

type a filter in the variable that contains the apostrophe and if you have inserted a counter before, or check if you have a function that escapes characters, type htmlspecialchars of php

    
07.08.2014 / 22:58