Mobile app version of vmapp.org
Login or Join
Yeniel560

: Get mysql_real_escape is giving me errors when I try and add security to my website I tried doing this: @ $db = new myConnectDB(); $beerName = mysql_real_escape_string($beerName); $beerID = mysql_real_escape_string($beerID);

@Yeniel560

Posted in: #Database #Mysql #Security #Sql

I tried doing this:
@ $db = new myConnectDB();


$beerName = mysql_real_escape_string($beerName);
$beerID = mysql_real_escape_string($beerID);
$brewery = mysql_real_escape_string($brewery);
$style = mysql_real_escape_string($style);
$userID = mysql_real_escape_string($userID);
$abv = mysql_real_escape_string($abv);
$ibu = mysql_real_escape_string($ibu);
$breweryID = mysql_real_escape_string($breweryID);
$icon = mysql_real_escape_string($icon);


I get this error:

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Yeniel560

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

All of PHP's mysql_* functions, including mysql_real_escape_string() have been deprecated, in favour of the mysqli and PDO extensions.

See Deprecated PHP (A blog set up by two StackOverflow members).

Use query binding (SELECT * FROM table WHERE ? with a $condition) and you won't have to use the function you mention.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme