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


im developed php user login , registration system, have displayed error in local host , how fix it? deprecated: mysql_connect(): mysql extension deprecated , removed in future: use mysqli or pdo instead (c:\wamp\www\registerations\db.php on line 9)

this code db.php

<?php $connection = mysql_connect('localhost', 'root', ''); if (!$connection){     die("database connection failed" . mysql_error()); } $select_db = mysql_select_db('register'); if (!$select_db){     die("database selection failed" . mysql_error()); } ?> 

  <?php $con = mysqli_connect("localhost","root","","register");  // check connection if (mysqli_connect_errno())  {  echo "failed connect mysql: " . mysqli_connect_error();   } ?>  

// try this..


Comments