saving . . . saved Uncaught Error: Call to undefined function mysql_connect() has been deleted. Uncaught Error: Call to undefined function mysql_connect() has been hidden .
Uncaught Error: Call to undefined function mysql_connect()
Title
Question
<span style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-size: medium;">Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\connect.php:2 Stack trace: #0 C:\xampp\htdocs\mysql.php(2): require() #1 {main} thrown in </span>C:\xampp\htdocs\connect.php<span style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-size: medium;"> on line s</span>
so please reply for this message to correct the errors

PHP-and-MySQL MySQL-Part-2 02-03 min 50-60 sec 16-08-20, 7:49 p.m. SHARINI2000

Answers:

Dear User,

If you are using a newer version of PHP then it should give an error. Please use mysqli function instead of mysql function.
For example: 
<?php
$connect = mysqli_connect("localhost","root","") or die("Connection Failed!");
mysqli_select_db("$connect","phpacademy") or die(mysqli_error());
echo "Connected!<p>";
?>
05-01-22, 4:18 p.m. hbammkanti


Log-in to answer to this question.