makesafe() and db_fetch_assoc()
Posted: 2020-02-28 17:29
I have a query that selects all the fields of other parent table
and inserts them in another child table
until here it works.
But, if a field contains an apostrophe in the text (like: D'Amico) obviously I have an error.
So I used "makesafe ()" but it doesn't work
I am confused about how to use makesafe, can someone help me, please
and inserts them in another child table
Code: Select all
$dati_fat = sql("SELECT * FROM `impianti` WHERE `id`= '{$data['id_imp']}' ", $eo);
$rowDaFa = db_fetch_assoc($dati_fat);
But, if a field contains an apostrophe in the text (like: D'Amico) obviously I have an error.
So I used "makesafe ()" but it doesn't work
Code: Select all
$dati_fat = sql("SELECT * FROM `impianti` WHERE `id`= '" . makeSafe($data['id_imp']) . "' ", $eo);
$dati_fat_ms = makeSafe($dati_fat);
$rowDaFa = db_fetch_assoc($dati_fat_ms);