Fatal error: Uncaught error: Call to undefined function mysql_connect() : Fatal error: Uncaught error: Call to undefined function mysql_connect() when connecting to the database using PHP validation code. This is because the version of PHP you are using does not support the older version of join statement writing. The PHP version used in this study is PHP-7.4.2-NTS-Win32-VC15-x64, and the verification code is:
< ?PHP
the mysql_connect (‘ 127.0.0.1 ‘, ‘runner_db_user’, ‘runner_db_password’)
the OR die (” Could not connect to the database. ‘);
the mysql_select_db (‘ hfjq_race_info ‘);
echo “Connected!” ;
?>
After inquiry, this writing method is the previous version of 5. X, the following code is as follows:
< ?php
$con=mysqli_connect(“127.0.0.1”, “runner_db_user”, “hfjq_race_info”)
OR die(‘Could not connect to database.’);
echo “Connected!” ;
?>
You can connect to the database normally. If you have extension=mysqli, change the semicolon “;” before extension=mysqli. You can connect to the MySQL database normally if you remove it
< ?PHP
the mysql_connect (‘ 127.0.0.1 ‘, ‘runner_db_user’, ‘runner_db_password’)
the OR die (” Could not connect to the database. ‘);
the mysql_select_db (‘ hfjq_race_info ‘);
echo “Connected!” ;
?>
After inquiry, this writing method is the previous version of 5. X, the following code is as follows:
< ?php
$con=mysqli_connect(“127.0.0.1”, “runner_db_user”, “hfjq_race_info”)
OR die(‘Could not connect to database.’);
echo “Connected!” ;
?>
You can connect to the database normally. If you have extension=mysqli, change the semicolon “;” before extension=mysqli. You can connect to the MySQL database normally if you remove it
Read More:
- Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- Call to undefined function oci_ Connect() problem solving
- Uncaught error: call to undefined function MySQL when building sqli lab environment with phpstudy_ Connect() error
- Uncaught Error: Call to undefined function mysql_select_db()
- PHP connection to MySQL database error: call to undefined function MySQL_ connect()
- Call to undefined function mysql_ Connect() solution summary
- PHP connection PostgreSQL error call to undefined function PG_ connect()
- mysql problem solving: mysqladmin: connect to server at’localhost’ failed
- Fatal error: Call to a member function bind_param() on a non-object in
- PHP Fatal error: Call to a member function query() on a non-object in
- PHP error: call to undefined function curl_ init() window
- bug-JAVA call SAP function Connect to SAP gateway failed
- Solve the problem that dbvisualizer cannot connect to mysql8
- Solving the problem of joi. Validate is not a function
- Problem solving: failed to connect to github.com port 443: Operation timed out(2020.06.04)
- C ා connect mysql: fatal error encountered during command execution solution
- Problem solving: PDF cannot be opened, and acrobat failed to connect to a DDE server appears
- Failed to connect to 127.0.0.1 port 43571: problem solving record
- MySQL: if the remote connection using navicatip fails, prompt “is not allowed to connect to this MySQL server”
- Solve the problem that node. js USES MySQL to connect econnunion 127.0.0.0.1:3306