Hi All,
What would be the best way to save XML to a database?
I mean I can use the example
'http://www.php.net/manual/en/function.mysql-real-escape-string.php'.
they give a function to prevent any SQL Injection,
function quote_smart($va lue)
{
// Stripslashes
if (get_magic_quot es_gpc()) {
$value = stripslashes($v alue);
}
// Quote if not integer
if (!is_numeric($v alue)) {
$value = "'" . mysql_real_esca pe_string($valu e) . "'";
}
return $value;
}
but then how do I get the data back, (as intended), from the db?
what would be the reverse of the above code?
Many thanks
Simon
What would be the best way to save XML to a database?
I mean I can use the example
'http://www.php.net/manual/en/function.mysql-real-escape-string.php'.
they give a function to prevent any SQL Injection,
function quote_smart($va lue)
{
// Stripslashes
if (get_magic_quot es_gpc()) {
$value = stripslashes($v alue);
}
// Quote if not integer
if (!is_numeric($v alue)) {
$value = "'" . mysql_real_esca pe_string($valu e) . "'";
}
return $value;
}
but then how do I get the data back, (as intended), from the db?
what would be the reverse of the above code?
Many thanks
Simon
Comment