Второй день мучаюсь с PHP и PHPMYADMIN проблема в том что в php7 по новому обращается к mysql. Так вот вытаюсь получить значения но выдает ошибки (код и ошибки ниже)
<?php
$link = mysqli_connect('localhost', 'admin', '12345' 'site_db');
if (!$link) {
die('Could not connect');
}
$results = mysqli_query($link, "SELECT id, status FROM demo_db");
mysqli_free_result($result);
// close connection
mysqli_close($link);
?>
Лог оибок:
[Thu Oct 19 08:51:15.889748 2017] [:error] [pid 1403] [client 10.114.1.45:49830] PHP Notice: Undefined variable: result in /var/www/site.ru/public_html/123.php on line 11
[Thu Oct 19 08:51:15.889804 2017] [:error] [pid 1403] [client 10.114.1.45:49830] PHP Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, null given in /var/www/site.ru/public_html/123.php on line 11
[Thu Oct 19 08:51:16.367797 2017] [:error] [pid 1403] [client 10.114.1.45:49830] PHP Notice: Undefined variable: result in /var/www/site.ru/public_html/123.php on line 11
[Thu Oct 19 08:51:16.367855 2017] [:error] [pid 1403] [client 10.114.1.45:49830] PHP Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, null given in /var/www/site.ru/public_html/123.php on line 11
[Thu Oct 19 08:51:16.685968 2017] [:error] [pid 1403] [client 10.114.1.45:49830] PHP Notice: Undefined variable: result in /var/www/site.ru/public_html/123.php on line 11
[Thu Oct 19 08:51:16.685997 2017] [:error] [pid 1403] [client 10.114.1.45:49830] PHP Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, null given in /var/www/site.ru/public_html/123.php on line 11
Версии ПО:
PHP 7.0.19-1 (cli) (built: May 11 2017 14:04:47) ( NTS )
mysql Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Linux Server-107 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux