Error while connecting to mysql database
Title
Question
I get the following error messege while conneting to database:
"Fatal error<span style="color: rgb(0, 0, 0); font-family: Calibri; font-size: medium;">: Uncaught Error: Call to undefined function mysql_connect() in C:\\xampp\\htdocs\\connect.php:3 Stack trace: #0 {main} thrown in </span>C:\\xampp\\htdocs\\connect.php<span style="color: rgb(0, 0, 0); font-family: Calibri; font-size: medium;"> on line </span>3"
<font color="#000000" face="Calibri" size="3">I am using XAMPP version 7.1.9 on OS Windows 7 SP 1. </font>
<font color="#000000" face="Calibri" size="3">php version is as same as xampp version</font>
PHP-and-MySQL MySQL-Part-2 01-02 min 50-60 sec
Answers:
I used mysli_connect instead of mysql_connect.Now it is working
if ur using new version of php then it should give error like this u need to use mysqli instead of mysql function
better u use the pdo object
$connect = new mysqli("localhost","root","")
try this if you are using new version
Login to add comment