PHP 5.5, how to enabled mysql_connect()?
-we have old site those have lot of mysql query and our server php version get up update soon so on my localhost have php 5.5.12 version and side trigger the error that mysql_connect() was deprecated, and now we can not convert all mysql query to mysqli so i need to enable mysql for php 5.5 version, if any one know about this lest me know.
Asked
Active
Viewed 5,698 times
2

Atul
- 27
- 1
- 11
-
In future versions you might use a shim, but 5.5/5.6 always incur those warnings. There are automated tools to rewrite it however. – mario Jun 23 '15 at 12:52
-
Hands off! Totaly deprecated function. Use PDO instead. – B001ᛦ Jun 23 '15 at 12:54
1 Answers
3
To suppress the deprecation message for this alone (and stay informed of other deprecations in your code) you can prefix the connect with @:
<?php
$connect = @mysql_connect('localhost','root','');
mysql_select_db('dbname');
?>

Santosh Jagtap
- 995
- 8
- 17