mysql - How to solve Function sql_regcase() is deprecated issue in php

754

Hello all i have coded following Program to secure the application. But after executing , i am getting following error Check here PHP code

http://pastebin.com/cgG5ezeg

Output :

Deprecated: Function sql_regcase() is deprecated in /home/admin/public_html/test/protect.php on line 6

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'root'@'localhost' (using password: NO) in /home/admin/public_html/test/protect.php on line 9

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/admin/public_html/test/protect.php on line 9

As well as please suggest me more secure way !

Thanks in advance

89

Answer

Solution:

regarding the sql_regcase function: it was deprecated in PHP V5.3.0 and shouldn't be used any longer.

Look at the PCRE extension.

note: use of mysql_* function is deprecated too so use pdo or mysqli

81

Answer

Solution:

Don't use deprecated functions.

The second warning is due to database connection failure. You had set "no" in the place of database password. change this and give your database password. it will work.

People are also looking for solutions to the problem: Pushing data to a html list for search using ajax, jquery and php, codeigniter

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.