L
L
likas7772017-10-18 11:45:28
PHP
likas777, 2017-10-18 11:45:28

Why can't I connect the PHPMYADMIN database to the site?

There is a local computer with Debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux
Apache2 and Phpmyadmin are also installed. The site is working fine, no complaints. I'm trying to connect the base. I created a user in phpmyadmin, created a database, entered test data. I create a file on the site:
1.php

<?php

$conect = mysql_connect('10.114.4.69', 'admin', '12345');
$db = mysql_select_db('my_db_site');

if (!$conect || !$db) {
  mysql_errno();
}else{
  echo 'Все хорошо';
};

?>

I go to the site neither site.ru/1.php in response, neither answer nor hello. Where to dig, I set it up for the first time, maybe I did something wrong. How to start a decision?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2017-10-18
@likas777

mysql_errno returns an error code instead of displaying it.

I
Igor, 2017-10-18
@DMGarikk

The base is where the site is located? try localhost instead of ip address write

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question