<!DOCTYPE html>
<html>
<head>
    <title>لزيادة العدد</title>
    <link href="styles.css" rel="stylesheet" />
<meta charset="UTF-8">
</head>
<body style="background-color:lightblue;">
<h1>
    
 <?php
include('admin_user_pass.php');




  $conn = new mysqli($servername, $username, $password, $dbname);
  // set the PDO error mode to exception
  if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "update general_setting set value=value+1 where Key_s='counter'";

$result = $conn->query($sql);


$sql2 = "select value as a from general_setting where Key_s='counter'";
$result2 = $conn->query($sql2);


if ($result2->num_rows > 0) {
  // output data of each row
  while($row = $result2->fetch_assoc()) {
    echo $row["a"];
  }
} else {
  echo -1;
}
$conn->close();
  

?>

</h1>
</body>
</html>