Hi,
I wanted to make a topic with this subject.
I'm working with MSSQL and I want to secure the users input in my Queries.
Unfortunately, MSSQL function doesn't have a real_escape_string function that allow me to secure the info.
I read some topic of people suggesting to use the addslashes function, but mssql does not use the backslash character as an escape mechanism.
A function like this one could help, but, I don't think it's a complete secure solution.
<?php
function mssql_addslashes($data) {
$data = str_replace("'", "''", $data);
return $data;
}
?>
Can anyone gives me an advice on this one ?
I wanted to make a topic with this subject.
I'm working with MSSQL and I want to secure the users input in my Queries.
Unfortunately, MSSQL function doesn't have a real_escape_string function that allow me to secure the info.
I read some topic of people suggesting to use the addslashes function, but mssql does not use the backslash character as an escape mechanism.
A function like this one could help, but, I don't think it's a complete secure solution.
<?php
function mssql_addslashes($data) {
$data = str_replace("'", "''", $data);
return $data;
}
?>
Can anyone gives me an advice on this one ?