• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Deprecated: mysql_escape_string()

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.

help?

PHP:
<?PHP
$idas = mysql_escape_string($_GET['idas']);
 
mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.

However if you use PHP 7 both of these wont work as mysql driver is ded

 
Did real not work? what was the error

Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

Warning: mysql_real_escape_string(): Access denied for user ''@'localhost' (using password: NO)

Warning: mysql_real_escape_string(): A link to the server could not be established
 
Okey so mysql_real_escape_string expects your mysql connection as the second parammetter, try doing that

However it loads the last connection open if its null so it should work. Are you sure your database connection is ok?
 
Okey so mysql_real_escape_string expects your mysql connection as the second parammetter, try doing that

However it loads the last connection open if its null so it should work. Are you sure your database connection is ok?

How I can do it? connection in second parammetter

db connection is ok
 
The link I posted shows exactly what you need.

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /var/www/html/pages/bans.php on line 9
Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: YES)
Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /var/www/html/pages/bans.php on line 17
 
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /var/www/html/pages/bans.php on line 9
Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: YES)

This says it isnt correct.
 
First of all, create a user for your server in your database. Don't just use root.
1. open MySQL CLI
2. create user 'forgottenserver'@'localhost' identified by 'passw0rd';
3. grant all privileges on forgottenserver.* to 'forgottenserver'@'localhost';
4. flush privileges;

Then try again but using the user you just created.
Typed from head so look up if the syntax checks out.

Second, use PDO.
 
First of all, create a user for your server in your database. Don't just use root.
1. open MySQL CLI
2. create user 'forgottenserver'@'localhost' identified by 'passw0rd';
3. grant all privileges on forgottenserver.* to 'forgottenserver'@'localhost';
4. flush privileges;

Then try again but using the user you just created.
Typed from head so look up if the syntax checks out.

Second, use PDO.
This has already been solved, but thank you
 
Back
Top