I have this problem. I am trying to connect to a database and push a text user. When I open the file I just get lots of errors. You can see the errors and my code further down. FYI: my database is in MySQLi
Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /www/webvol9/rj/fxgnq6r66hz6x2j/my domain/public_html/action_page.php on line 3
Warning: mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /www/webvol9/rj/fxgnq6r66hz6x2j/my domain/public_html/action_page.php on line 3
Notice: Undefined variable: query in /www/webvol9/rj/fxgnq6r66hz6x2j/my domain/public_html/action_page.php on line 7
Warning: mysqli::prepare(): Couldn't fetch mysqli in /www/webvol9/rj/fxgnq6r66hz6x2j/my domain/public_html/action_page.php on line 7
Fatal error: Uncaught Error: Call to a member function execute() on null in /www/webvol9/rj/fxgnq6r66hz6x2j/my domain/public_html/action_page.php:8 Stack trace: #0 {main} thrown in /www/webvol9/rj/fxgnq6r66hz6x2j/my domain/public_html/action_page.php on line 8
<?php
// Create connection
$mysqli = new mysqli("https://mysql687.loopia.se", "USERNAME", "PASSWORD", "People");
$query = "INSERT INTO 'People' ('Name', 'Password', 'Username') VALUES ('Emil', 'hejhej', 'emil')";
$stmt = $mysqli->prepare($query);
$stmt->execute();
$mysqli->close();
$stmt->close();
?>


$queryinstead of$querrymysqli('localhost', 'my_user', 'my_password', 'my_db');$queryvariable name. Write$queryinstead of$querry