I am learning the core PHP and write the below code for testing the connection with the database. I get this error:
Fatal error: Class 'mysql_connect' not found in C:\xampp\htdocs\demo\index.php on line 4"
The code is below:
<?php
$dbcon = new mysql_connect("localhost", "root", "");
mysql_select_db("demo", $dbcon);
$query = mysql_query("select name FROM test ");
echo mysql_num_row($query);
mysql_close($dbcon);
?>