Hi Everyone
I am facing this error do not know how to fix it
with codeing
<?php
$con=mysql_connect("localhost","root","01959719");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// Create database
$sql="CREATE DATABASE customer";
if (mysql_query($con,$sql))
{
echo "Database aqurium created successfully";
}
else
{
echo "Error creating database: " . mysql_error($con);
}
?>
Call to undefined function mysql_connect()
I already check on the extention on php.ini file in the folder. Please kindly help .
Please help
Moderator: General Moderators
Re: Please help
This has nothing to do with frameworks. Please try to post in the right forum.
You're mixing mysql_ and mysqli_ functions. As I have already mentioned in another of your threads, they are not the same thing and cannot be used interchangeably.
Check phpinfo() to see if the mysql extension is being loaded. Better still, stop using it. mysql_ has been deprecated and is going to be removed from PHP altogether. Use PDO instead.
You're mixing mysql_ and mysqli_ functions. As I have already mentioned in another of your threads, they are not the same thing and cannot be used interchangeably.
Check phpinfo() to see if the mysql extension is being loaded. Better still, stop using it. mysql_ has been deprecated and is going to be removed from PHP altogether. Use PDO instead.