D
D
DVoropaev2016-12-16 20:33:56
PHP
DVoropaev, 2016-12-16 20:33:56

The server is not connecting to mysql. Where to dig?

<!DOCTYPE HTML>
<html>
<head>
  <?php
   $link = mysql_connect('localhost', 'root', 'gfueduvuru235', 'game');
   if ( !$link ) die ("Невозможно подключение к MySQL");
  ?>
  <meta charset="utf-8">
  <link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>


<div class="container">
<canvas id="scene" width="1300" height="600"></canvas>
</div>  

</body>
</html>

78edbc85deb14251aae53f4f064ca6f8.pnge7eb8b65434c48bcad8edd459c00ce9c.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SagePtr, 2016-12-16
@SagePtr

Do you have mysql extension in PHP? It was thrown out of PHP 7, because it is very outdated.

A
A person from Kazakhstan, 2016-12-16
@LenovoId

is that a node server?

M
Michael, 2016-12-17
@MikeDeblin

$link = mysql_connect('localhost', 'root', 'gfueduvuru235', 'game');

The fourth parameter ('game') is what? DB name?
Then you are using the mysql_connect function incorrectly.
From the manual follows:
mysql_connect ($server , $username , $password, bool $new_link , $client_flags )
and yours looks more like
mysqli_connect ("127.0.0.1", "my_user", "my_password", "my_db");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question