I'm trying to insert information into database through two inputs when you click a submit button. But when I click it it says it can't connect to localhost (everything else works so I know it has to be some form of syntax problem) Code:
<form action="prices.inc.php" method="post">
<input class="price-list-input" type="text" id="priceupdate1" name="priceupdate1" required></input>
<input class="price-list-input2" type="text" id="priceupdate2" name="priceupdate2" required></input>
<input class="price-list-button" type="submit" id="priceupdate-button" name="priceupdate-button" value="Uppdatera"></input>
</form>
the php..
<?php
require_once('check_login.inc.php');
define('SECURE', true);
require_once('connection.php');
if(isset($_POST['priceupdate-button'])){
$info = trim(htmlspecialchars($_POST['priceupdate1'], $_POST['priceupdate2']));
// prepared statement
$stmt = $db->prepare('INSERT INTO prices (name, price) VALUES = (?, ?)');
$stmt->bind_param('ss', $_POST['priceupdate1'], $_POST['priceupdate2']);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($info);
}
?>