-1

So, I have some bug in this code that will not execute the query, it just says The localhost page isn’t working - localhost is currently unable to handle this request. And that error shows only when there's some bug in the code, so it won't execute it. I don't know what's the problem here, as I tried to connect to database and that's all ok. Problem lies in lines underneath the connect.php.

if($_POST) {
include('connection.php');
$id_broj  =  $_POST['id_num'];
$password = $_POST['password']; 

$query=mysqli_query("SELECT id,id_broj,ime,prezime FROM zaposleni");
$result=mysqli_query($conn,$query); 
$count=mysqli_num_rows($result);
$row=mysqli_fetch_array($result);

echo 'Passed';
}
ArK
  • 18,824
  • 63
  • 101
  • 135
revetinja
  • 55
  • 1
  • 10

1 Answers1

0

Need to write only query in $query Variable as:

  if($_POST) {
    include('connection.php');
    $id_broj  =  $_POST['id_num'];
    $password = $_POST['password']; 

    $query="SELECT id,id_broj,ime,prezime FROM zaposleni";
    $result=mysqli_query($conn,$query); 
    $count=mysqli_num_rows($result);
    $row=mysqli_fetch_array($result);

    echo 'Passed';
    }
Vikas Umrao
  • 2,730
  • 1
  • 12
  • 23