I
I
Ivan Shumakov2017-10-24 22:10:51
linux
Ivan Shumakov, 2017-10-24 22:10:51

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

3 answer(s)
S
Sergej, 2017-10-24
@ivanshumakov

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.
59ef90f3d1abb790054234.png

L
lubezniy, 2017-10-24
@lubezniy

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.

D
Don Gan, 2017-10-25
@PravdorubMSK

Use MySQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question