The database won't update. What is the problem? I tried in many ways, all failed. I read the mysqli dictionary, the code should be working but it's not.
This is edit.php
<?php require_once 'header.php' ?>
<?php
$id = $_GET['id'];
?>
<div class="container">
<form method="post" <?php echo "action='edit_resultu.php?id=".$id."'"; ?>>
<input type="text" name="track" class="form-control" placeholder="Enter track" maxlength="70"/>
<button type="submit" class="btn btn-block btn-primary" name="update">Submit</button>
</form>
</div>
</body>
</html>
this is edit_resultu.php
<?php
if(isset($_POST['update']))
{
$id = $_GET['id'];
$track = $_POST['track'];
$query = "UPDATE `db71038521`.`packs` SET track = `$track` WHERE `packs`.`id` = '$id'";
if(!mysqli_query($conn, $query))
{
die('Could not update data: ' . mysqli_error($query));
}
echo "Updated data successfully\n";
}
?>
</body>
</html>