Caute,
na jednej mojej stranke chcem vyuzit pri prihlasovani na ochranu proti SQL Injectom (neviem, ci je to najbezpecnejsie riesenie

) toto:
Kód:
function cleanQuery($string)
{
if(get_magic_quotes_gpc())
{
$string = stripslashes($string);
}
if (phpversion() >= '4.3.0')
{
$string = mysql_real_escape_string($string);
}
else
{
$string = mysql_escape_string($string);
}
return $string;
}
if( isset($_POST['submit'])) {
$meno=cleanQuery($_POST['meno']);
$meno=trim($meno);
.......
vyhadzuje mi to vsak stale tuto chybu:
Citácia:
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\wamp\www\xxxxxxxx\index.php on line 13
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\wamp\www\xxxxxx\index.php on line 13
pricom riadok 13 je ten, kde je:
Kód:
$string = mysql_real_escape_string($string);
v com moze byt chyba?
Poznamky: databaza existuje spolu s tabulkami, prava su nastavene tak ako maju byt a heslo na pripojenie na DB je tiez 100% OK (meno uzivatela je root - len na testovacie ucely na localhoste). Pouzivam PHP 5.3.0 a MySQL 5.1.36
DIK.