My php doesn't show the error message?

I wanna to work with database but my code has error and it doesn’t give the error where is the error.

Have you checked in the error log files?

Show us your code, and tell us which line has the error on it. If it’s a query, does the same query fail in MySQL if you type it directly? Have you enabled error reporting while debugging your code?

1 Like

the problem is with session.

i cant find that where is it.

@Almasi, we can’t help you if you don’t post your code for us to see.

<?php if (isset($_POST['login'])): ?>
      $email = $_POST['email'];
      $password = $_POST['password'];
      foreach ($users as $user) {
          if ($email == $user['email'] && $password == $user['password']) {
            $_SESSION['login'] = $email;
            $_SESSION['user_id'] = $user['id'];
            $_SESSION['user_name'] = $user['name'];
          }else {
           echo "Wrong user name or password";
<?php endif; ?>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.