best practice against sql injections in module
Posted: Mon Nov 30, 2009 6:16 pm
Hello everybody.
in the module that I realized (shoutbox) i took care to fight against sql injections with this function
no problem since its establishment until today when a user alerted me to a problem with installation. After some research I found the error : Indeed, the user uses the database as follows
База данных сервера (server_db_type): MySQL (mysqli) _<
So my question: is there a solution in the API csmsms for escaping strings securely and regardless of the type of database user?
if appropriate, are there in the API the way to retrieve the necessary value: mysqli $link ?
thank you hugely in advance for your attention and your answers.
Bess
in the module that I realized (shoutbox) i took care to fight against sql injections with this function
Code: Select all
function _cleanString($string)
{
$string = trim($string);
$string = htmlentities($string, ENT_QUOTES, 'UTF-8');
$string = mysql_real_escape_string($string);
return $string;
}
База данных сервера (server_db_type): MySQL (mysqli) _<
So my question: is there a solution in the API csmsms for escaping strings securely and regardless of the type of database user?
if appropriate, are there in the API the way to retrieve the necessary value: mysqli $link ?
thank you hugely in advance for your attention and your answers.

Bess