Hello, in web host have config.php from my database. On my computer have local server. When from php file on my computer i try to connect with databasse on web host with connfig file on web host somting wrong…
config.php on web host
<?php
$servername = 'host';
$username = 'user';
$password = 'pass';
$dbname = 'db';
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
set_time_limit(500);
// Check connection
if ($conn->connect_error) {
die("Проблем с интернета или достъпа ! ");
}
?>
Playlist.php local
include 'https://website.eu/config.php';
$sql ="SELECT * FROM playlist WHERE playnow > 0 ORDER BY playnow ASC" ;
$result = $conn->query($sql);
Error:
Warning : Undefined variable $conn in C:\Users\user\Desktop\laragon-portable\www\loadplaylist.php on line 7
Fatal error : Uncaught Error: Call to a member function query() on null in C:\Users\user\Desktop\laragon-portable\www\loadplaylist.php:7 Stack trace: #0 {main} thrown in C:\Users\user\Desktop\laragon-portable\www\loadplaylist.php on line 7
How to fix it ?