Answer the question
In order to leave comments, you need to log in
Why doesn't PHP communicate with MySQL?
I'm trying to connect to MySQL using the mysql_connect() PHP function, but it doesn't work. The terminal writes the following: PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/1/scripts/connect.php:2
What is the problem and how to solve it?
Answer the question
In order to leave comments, you need to log in
And why are you using mysql_connect ?
There is no such function anymore, and the error tells you about it in a clear language.
All information is here php.net/manual/ru/function.mysql-connect.php
It is written in Russian.
Install the mysql extension. For php7 - compile (comes as pecl).
In general, it is preferable to use PDO or at least mysqli. But for them, the appropriate extensions need to be installed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question