1
I am using php and mysql and would like to pass the following parameter to a stored Procedure
$param = "col = '{"video":"<iframe width=\'480\' height=\'600\' src=\'www.qualquercoisa.com\´"}'";
call spActCol($param);
but it turns out that stored Procedure nullifies all escaped characters which creates an error when trying to update the database, that is, internally in the previous sentence:
UPDATE exemple SET col = '{"video":"<iframe width='480' height='600' src='www.qualquercoisa.com'"}' where id=1;
Someone has an idea how to solve this problem?
Ever tried to put src=''www.qualquercoisa.com'' like this? With two single quotes.
– Marconi
already solved the problem ?
– SneepS NinjA
param = "col = '{"video":"<iframe width='480' height='600' src='www.qualquercoisa.com "}'"; call spActCol(mysql_real_escape_string($param)); The function mysql_real_escape_string will escape all ' and " so that it remains a string. Another way would be to make parameterized queries.
– Wilson -