0

I received a message like

mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead" while trying to open with localhost.

$baglanti=mysql_connect("localhost","root","");
mysql_select_db("veri",$baglanti);

What is the problem on there?

chris85
  • 23,846
  • 7
  • 34
  • 51
BT29
  • 1
  • 2
    The problem is literally described right there, the mysql_* functions are deprecated, don't use them. – Enstage Jun 07 '17 at 01:25
  • **WARNING**: If you're just learning PHP, please, do not learn the obsolete [`mysql_query`](http://php.net/manual/en/function.mysql-query.php) interface. It's awful and has been removed in PHP 7. A replacement like [PDO is not hard to learn](http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/) and a guide like [PHP The Right Way](http://www.phptherightway.com/) helps explain best practices. Make **sure** your user parameters are [properly escaped](http://bobby-tables.com/php) or you will end up with severe [SQL injection bugs](http://bobby-tables.com/). – tadman Jun 07 '17 at 02:57

0 Answers0