MySQLi Login Form with PHP - Fatal error: Uncaught Error: Call to a member function close() on boolean












0















This is my code, and i think the issue is with $stmt->close(); as the error says. But i don't know how to fix it. I have searched the other questions but i can't find an answer (at least it's not helping me, the answers are all confusing :) )
Can you guys please help me?



<?php
// Initialize the session
session_start();

// Check if the user is already logged in, if yes then redirect him to
welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
header("location: dash.php");
exit;
}

// Include config file
require_once "config.php";

// Define variables and initialize with empty values
$username = $password = "";
$username_err = $password_err = "";

// Processing form data when form is submitted
if($_SERVER["REQUEST_METHOD"] == "POST"){

// Check if username is empty
if(empty(trim($_POST["username"]))){
$username_err = "Please enter username.";
} else{
$username = trim($_POST["username"]);
}

// Check if password is empty
if(empty(trim($_POST["password"]))){
$password_err = "Please enter your password.";
} else{
$password = trim($_POST["password"]);
}

// Validate credentials
if(empty($username_err) && empty($password_err)){
// Prepare a select statement
$sql = "SELECT id, username, password FROM employees WHERE username =
?";

if($stmt = $mysqli->prepare($sql)){
// Bind variables to the prepared statement as parameters
$stmt->bind_param("s", $param_username);

// Set parameters
$param_username = $username;

// Attempt to execute the prepared statement
if($stmt->execute()){
// Store result
$stmt->store_result();

// Check if username exists, if yes then verify password
if($stmt->num_rows == 1){
// Bind result variables
$stmt->bind_result($id, $username, $hashed_password);
if($stmt->fetch()){
if(password_verify($password, $hashed_password)){
// Password is correct, so start a new session
session_start();

// Store data in session variables
$_SESSION["loggedin"] = true;
$_SESSION["id"] = $id;
$_SESSION["username"] = $username;

// Redirect user to welcome page
header("location: dash.php");
} else{
// Display an error message if password is not valid
$password_err = "The password you entered was not
valid.";
}
}
} else{
// Display an error message if username doesn't exist
$username_err = "No account found with that username.";
}
} else{
echo "Oops! Something went wrong. Please try again later.";
}
}

// Close statement
$stmt->close();
}

// Close connection
$mysqli->close();
}
?>


This is what i'm getting - img










share|improve this question





























    0















    This is my code, and i think the issue is with $stmt->close(); as the error says. But i don't know how to fix it. I have searched the other questions but i can't find an answer (at least it's not helping me, the answers are all confusing :) )
    Can you guys please help me?



    <?php
    // Initialize the session
    session_start();

    // Check if the user is already logged in, if yes then redirect him to
    welcome page
    if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
    header("location: dash.php");
    exit;
    }

    // Include config file
    require_once "config.php";

    // Define variables and initialize with empty values
    $username = $password = "";
    $username_err = $password_err = "";

    // Processing form data when form is submitted
    if($_SERVER["REQUEST_METHOD"] == "POST"){

    // Check if username is empty
    if(empty(trim($_POST["username"]))){
    $username_err = "Please enter username.";
    } else{
    $username = trim($_POST["username"]);
    }

    // Check if password is empty
    if(empty(trim($_POST["password"]))){
    $password_err = "Please enter your password.";
    } else{
    $password = trim($_POST["password"]);
    }

    // Validate credentials
    if(empty($username_err) && empty($password_err)){
    // Prepare a select statement
    $sql = "SELECT id, username, password FROM employees WHERE username =
    ?";

    if($stmt = $mysqli->prepare($sql)){
    // Bind variables to the prepared statement as parameters
    $stmt->bind_param("s", $param_username);

    // Set parameters
    $param_username = $username;

    // Attempt to execute the prepared statement
    if($stmt->execute()){
    // Store result
    $stmt->store_result();

    // Check if username exists, if yes then verify password
    if($stmt->num_rows == 1){
    // Bind result variables
    $stmt->bind_result($id, $username, $hashed_password);
    if($stmt->fetch()){
    if(password_verify($password, $hashed_password)){
    // Password is correct, so start a new session
    session_start();

    // Store data in session variables
    $_SESSION["loggedin"] = true;
    $_SESSION["id"] = $id;
    $_SESSION["username"] = $username;

    // Redirect user to welcome page
    header("location: dash.php");
    } else{
    // Display an error message if password is not valid
    $password_err = "The password you entered was not
    valid.";
    }
    }
    } else{
    // Display an error message if username doesn't exist
    $username_err = "No account found with that username.";
    }
    } else{
    echo "Oops! Something went wrong. Please try again later.";
    }
    }

    // Close statement
    $stmt->close();
    }

    // Close connection
    $mysqli->close();
    }
    ?>


    This is what i'm getting - img










    share|improve this question



























      0












      0








      0








      This is my code, and i think the issue is with $stmt->close(); as the error says. But i don't know how to fix it. I have searched the other questions but i can't find an answer (at least it's not helping me, the answers are all confusing :) )
      Can you guys please help me?



      <?php
      // Initialize the session
      session_start();

      // Check if the user is already logged in, if yes then redirect him to
      welcome page
      if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
      header("location: dash.php");
      exit;
      }

      // Include config file
      require_once "config.php";

      // Define variables and initialize with empty values
      $username = $password = "";
      $username_err = $password_err = "";

      // Processing form data when form is submitted
      if($_SERVER["REQUEST_METHOD"] == "POST"){

      // Check if username is empty
      if(empty(trim($_POST["username"]))){
      $username_err = "Please enter username.";
      } else{
      $username = trim($_POST["username"]);
      }

      // Check if password is empty
      if(empty(trim($_POST["password"]))){
      $password_err = "Please enter your password.";
      } else{
      $password = trim($_POST["password"]);
      }

      // Validate credentials
      if(empty($username_err) && empty($password_err)){
      // Prepare a select statement
      $sql = "SELECT id, username, password FROM employees WHERE username =
      ?";

      if($stmt = $mysqli->prepare($sql)){
      // Bind variables to the prepared statement as parameters
      $stmt->bind_param("s", $param_username);

      // Set parameters
      $param_username = $username;

      // Attempt to execute the prepared statement
      if($stmt->execute()){
      // Store result
      $stmt->store_result();

      // Check if username exists, if yes then verify password
      if($stmt->num_rows == 1){
      // Bind result variables
      $stmt->bind_result($id, $username, $hashed_password);
      if($stmt->fetch()){
      if(password_verify($password, $hashed_password)){
      // Password is correct, so start a new session
      session_start();

      // Store data in session variables
      $_SESSION["loggedin"] = true;
      $_SESSION["id"] = $id;
      $_SESSION["username"] = $username;

      // Redirect user to welcome page
      header("location: dash.php");
      } else{
      // Display an error message if password is not valid
      $password_err = "The password you entered was not
      valid.";
      }
      }
      } else{
      // Display an error message if username doesn't exist
      $username_err = "No account found with that username.";
      }
      } else{
      echo "Oops! Something went wrong. Please try again later.";
      }
      }

      // Close statement
      $stmt->close();
      }

      // Close connection
      $mysqli->close();
      }
      ?>


      This is what i'm getting - img










      share|improve this question
















      This is my code, and i think the issue is with $stmt->close(); as the error says. But i don't know how to fix it. I have searched the other questions but i can't find an answer (at least it's not helping me, the answers are all confusing :) )
      Can you guys please help me?



      <?php
      // Initialize the session
      session_start();

      // Check if the user is already logged in, if yes then redirect him to
      welcome page
      if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
      header("location: dash.php");
      exit;
      }

      // Include config file
      require_once "config.php";

      // Define variables and initialize with empty values
      $username = $password = "";
      $username_err = $password_err = "";

      // Processing form data when form is submitted
      if($_SERVER["REQUEST_METHOD"] == "POST"){

      // Check if username is empty
      if(empty(trim($_POST["username"]))){
      $username_err = "Please enter username.";
      } else{
      $username = trim($_POST["username"]);
      }

      // Check if password is empty
      if(empty(trim($_POST["password"]))){
      $password_err = "Please enter your password.";
      } else{
      $password = trim($_POST["password"]);
      }

      // Validate credentials
      if(empty($username_err) && empty($password_err)){
      // Prepare a select statement
      $sql = "SELECT id, username, password FROM employees WHERE username =
      ?";

      if($stmt = $mysqli->prepare($sql)){
      // Bind variables to the prepared statement as parameters
      $stmt->bind_param("s", $param_username);

      // Set parameters
      $param_username = $username;

      // Attempt to execute the prepared statement
      if($stmt->execute()){
      // Store result
      $stmt->store_result();

      // Check if username exists, if yes then verify password
      if($stmt->num_rows == 1){
      // Bind result variables
      $stmt->bind_result($id, $username, $hashed_password);
      if($stmt->fetch()){
      if(password_verify($password, $hashed_password)){
      // Password is correct, so start a new session
      session_start();

      // Store data in session variables
      $_SESSION["loggedin"] = true;
      $_SESSION["id"] = $id;
      $_SESSION["username"] = $username;

      // Redirect user to welcome page
      header("location: dash.php");
      } else{
      // Display an error message if password is not valid
      $password_err = "The password you entered was not
      valid.";
      }
      }
      } else{
      // Display an error message if username doesn't exist
      $username_err = "No account found with that username.";
      }
      } else{
      echo "Oops! Something went wrong. Please try again later.";
      }
      }

      // Close statement
      $stmt->close();
      }

      // Close connection
      $mysqli->close();
      }
      ?>


      This is what i'm getting - img







      php html mysql login






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 '18 at 17:39







      Blagojce

















      asked Nov 25 '18 at 16:42









      BlagojceBlagojce

      187




      187
























          2 Answers
          2






          active

          oldest

          votes


















          1














          $stmt->close() needs to be inside if($stmt = $mysqli->prepare($sql)). If that fails, $stmt is set to false so you're trying to call file->close(), which makes no sense. You should also have an else block to display the reason why it failed.



          // Validate credentials
          if(empty($username_err) && empty($password_err)){
          // Prepare a select statement
          $sql = "SELECT id, username, password FROM employees WHERE username =
          ?";

          if($stmt = $mysqli->prepare($sql)){
          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s", $param_username);

          // Set parameters
          $param_username = $username;

          // Attempt to execute the prepared statement
          if($stmt->execute()){
          // Store result
          $stmt->store_result();

          // Check if username exists, if yes then verify password
          if($stmt->num_rows == 1){
          // Bind result variables
          $stmt->bind_result($id, $username, $hashed_password);
          if($stmt->fetch()){
          if(password_verify($password, $hashed_password)){
          // Password is correct, so start a new session
          session_start();

          // Store data in session variables
          $_SESSION["loggedin"] = true;
          $_SESSION["id"] = $id;
          $_SESSION["username"] = $username;

          // Redirect user to welcome page
          header("location: dash.php");
          } else{
          // Display an error message if password is not valid
          $password_err = "The password you entered was not
          valid.";
          }
          }
          } else{
          // Display an error message if username doesn't exist
          $username_err = "No account found with that username.";
          }
          } else{
          echo "Oops! Something went wrong. Please try again later.";
          }
          // Close statement
          $stmt->close();
          } else {
          die($mysqli->error);
          }
          }





          share|improve this answer
























          • Thank you very much :)

            – Blagojce
            Nov 25 '18 at 17:36





















          0














          Assuming the brackets are aligned...
          If it's that line, $stmt = $mysqli->prepare($sql) resulted in $stmt being false. The close method doesn't exist for a boolean. Your code expected a statement object.



          So preparing the statement went wrong.
          Check the statement for syntax errors or invalid column and table names, etc.



          The following lines should be switched together also:



          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s" $param_username); // Set parameters
          $param_username = $username;





          share|improve this answer
























          • thanks a lot man

            – Blagojce
            Nov 25 '18 at 17:38











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53469648%2fmysqli-login-form-with-php-fatal-error-uncaught-error-call-to-a-member-funct%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          $stmt->close() needs to be inside if($stmt = $mysqli->prepare($sql)). If that fails, $stmt is set to false so you're trying to call file->close(), which makes no sense. You should also have an else block to display the reason why it failed.



          // Validate credentials
          if(empty($username_err) && empty($password_err)){
          // Prepare a select statement
          $sql = "SELECT id, username, password FROM employees WHERE username =
          ?";

          if($stmt = $mysqli->prepare($sql)){
          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s", $param_username);

          // Set parameters
          $param_username = $username;

          // Attempt to execute the prepared statement
          if($stmt->execute()){
          // Store result
          $stmt->store_result();

          // Check if username exists, if yes then verify password
          if($stmt->num_rows == 1){
          // Bind result variables
          $stmt->bind_result($id, $username, $hashed_password);
          if($stmt->fetch()){
          if(password_verify($password, $hashed_password)){
          // Password is correct, so start a new session
          session_start();

          // Store data in session variables
          $_SESSION["loggedin"] = true;
          $_SESSION["id"] = $id;
          $_SESSION["username"] = $username;

          // Redirect user to welcome page
          header("location: dash.php");
          } else{
          // Display an error message if password is not valid
          $password_err = "The password you entered was not
          valid.";
          }
          }
          } else{
          // Display an error message if username doesn't exist
          $username_err = "No account found with that username.";
          }
          } else{
          echo "Oops! Something went wrong. Please try again later.";
          }
          // Close statement
          $stmt->close();
          } else {
          die($mysqli->error);
          }
          }





          share|improve this answer
























          • Thank you very much :)

            – Blagojce
            Nov 25 '18 at 17:36


















          1














          $stmt->close() needs to be inside if($stmt = $mysqli->prepare($sql)). If that fails, $stmt is set to false so you're trying to call file->close(), which makes no sense. You should also have an else block to display the reason why it failed.



          // Validate credentials
          if(empty($username_err) && empty($password_err)){
          // Prepare a select statement
          $sql = "SELECT id, username, password FROM employees WHERE username =
          ?";

          if($stmt = $mysqli->prepare($sql)){
          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s", $param_username);

          // Set parameters
          $param_username = $username;

          // Attempt to execute the prepared statement
          if($stmt->execute()){
          // Store result
          $stmt->store_result();

          // Check if username exists, if yes then verify password
          if($stmt->num_rows == 1){
          // Bind result variables
          $stmt->bind_result($id, $username, $hashed_password);
          if($stmt->fetch()){
          if(password_verify($password, $hashed_password)){
          // Password is correct, so start a new session
          session_start();

          // Store data in session variables
          $_SESSION["loggedin"] = true;
          $_SESSION["id"] = $id;
          $_SESSION["username"] = $username;

          // Redirect user to welcome page
          header("location: dash.php");
          } else{
          // Display an error message if password is not valid
          $password_err = "The password you entered was not
          valid.";
          }
          }
          } else{
          // Display an error message if username doesn't exist
          $username_err = "No account found with that username.";
          }
          } else{
          echo "Oops! Something went wrong. Please try again later.";
          }
          // Close statement
          $stmt->close();
          } else {
          die($mysqli->error);
          }
          }





          share|improve this answer
























          • Thank you very much :)

            – Blagojce
            Nov 25 '18 at 17:36
















          1












          1








          1







          $stmt->close() needs to be inside if($stmt = $mysqli->prepare($sql)). If that fails, $stmt is set to false so you're trying to call file->close(), which makes no sense. You should also have an else block to display the reason why it failed.



          // Validate credentials
          if(empty($username_err) && empty($password_err)){
          // Prepare a select statement
          $sql = "SELECT id, username, password FROM employees WHERE username =
          ?";

          if($stmt = $mysqli->prepare($sql)){
          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s", $param_username);

          // Set parameters
          $param_username = $username;

          // Attempt to execute the prepared statement
          if($stmt->execute()){
          // Store result
          $stmt->store_result();

          // Check if username exists, if yes then verify password
          if($stmt->num_rows == 1){
          // Bind result variables
          $stmt->bind_result($id, $username, $hashed_password);
          if($stmt->fetch()){
          if(password_verify($password, $hashed_password)){
          // Password is correct, so start a new session
          session_start();

          // Store data in session variables
          $_SESSION["loggedin"] = true;
          $_SESSION["id"] = $id;
          $_SESSION["username"] = $username;

          // Redirect user to welcome page
          header("location: dash.php");
          } else{
          // Display an error message if password is not valid
          $password_err = "The password you entered was not
          valid.";
          }
          }
          } else{
          // Display an error message if username doesn't exist
          $username_err = "No account found with that username.";
          }
          } else{
          echo "Oops! Something went wrong. Please try again later.";
          }
          // Close statement
          $stmt->close();
          } else {
          die($mysqli->error);
          }
          }





          share|improve this answer













          $stmt->close() needs to be inside if($stmt = $mysqli->prepare($sql)). If that fails, $stmt is set to false so you're trying to call file->close(), which makes no sense. You should also have an else block to display the reason why it failed.



          // Validate credentials
          if(empty($username_err) && empty($password_err)){
          // Prepare a select statement
          $sql = "SELECT id, username, password FROM employees WHERE username =
          ?";

          if($stmt = $mysqli->prepare($sql)){
          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s", $param_username);

          // Set parameters
          $param_username = $username;

          // Attempt to execute the prepared statement
          if($stmt->execute()){
          // Store result
          $stmt->store_result();

          // Check if username exists, if yes then verify password
          if($stmt->num_rows == 1){
          // Bind result variables
          $stmt->bind_result($id, $username, $hashed_password);
          if($stmt->fetch()){
          if(password_verify($password, $hashed_password)){
          // Password is correct, so start a new session
          session_start();

          // Store data in session variables
          $_SESSION["loggedin"] = true;
          $_SESSION["id"] = $id;
          $_SESSION["username"] = $username;

          // Redirect user to welcome page
          header("location: dash.php");
          } else{
          // Display an error message if password is not valid
          $password_err = "The password you entered was not
          valid.";
          }
          }
          } else{
          // Display an error message if username doesn't exist
          $username_err = "No account found with that username.";
          }
          } else{
          echo "Oops! Something went wrong. Please try again later.";
          }
          // Close statement
          $stmt->close();
          } else {
          die($mysqli->error);
          }
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 25 '18 at 17:07









          BarmarBarmar

          432k36255356




          432k36255356













          • Thank you very much :)

            – Blagojce
            Nov 25 '18 at 17:36





















          • Thank you very much :)

            – Blagojce
            Nov 25 '18 at 17:36



















          Thank you very much :)

          – Blagojce
          Nov 25 '18 at 17:36







          Thank you very much :)

          – Blagojce
          Nov 25 '18 at 17:36















          0














          Assuming the brackets are aligned...
          If it's that line, $stmt = $mysqli->prepare($sql) resulted in $stmt being false. The close method doesn't exist for a boolean. Your code expected a statement object.



          So preparing the statement went wrong.
          Check the statement for syntax errors or invalid column and table names, etc.



          The following lines should be switched together also:



          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s" $param_username); // Set parameters
          $param_username = $username;





          share|improve this answer
























          • thanks a lot man

            – Blagojce
            Nov 25 '18 at 17:38
















          0














          Assuming the brackets are aligned...
          If it's that line, $stmt = $mysqli->prepare($sql) resulted in $stmt being false. The close method doesn't exist for a boolean. Your code expected a statement object.



          So preparing the statement went wrong.
          Check the statement for syntax errors or invalid column and table names, etc.



          The following lines should be switched together also:



          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s" $param_username); // Set parameters
          $param_username = $username;





          share|improve this answer
























          • thanks a lot man

            – Blagojce
            Nov 25 '18 at 17:38














          0












          0








          0







          Assuming the brackets are aligned...
          If it's that line, $stmt = $mysqli->prepare($sql) resulted in $stmt being false. The close method doesn't exist for a boolean. Your code expected a statement object.



          So preparing the statement went wrong.
          Check the statement for syntax errors or invalid column and table names, etc.



          The following lines should be switched together also:



          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s" $param_username); // Set parameters
          $param_username = $username;





          share|improve this answer













          Assuming the brackets are aligned...
          If it's that line, $stmt = $mysqli->prepare($sql) resulted in $stmt being false. The close method doesn't exist for a boolean. Your code expected a statement object.



          So preparing the statement went wrong.
          Check the statement for syntax errors or invalid column and table names, etc.



          The following lines should be switched together also:



          // Bind variables to the prepared statement as parameters
          $stmt->bind_param("s" $param_username); // Set parameters
          $param_username = $username;






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 25 '18 at 17:06









          dn Ferdn Fer

          8801820




          8801820













          • thanks a lot man

            – Blagojce
            Nov 25 '18 at 17:38



















          • thanks a lot man

            – Blagojce
            Nov 25 '18 at 17:38

















          thanks a lot man

          – Blagojce
          Nov 25 '18 at 17:38





          thanks a lot man

          – Blagojce
          Nov 25 '18 at 17:38


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53469648%2fmysqli-login-form-with-php-fatal-error-uncaught-error-call-to-a-member-funct%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Create new schema in PostgreSQL using DBeaver

          Deepest pit of an array with Javascript: test on Codility

          Costa Masnaga