I dont know why this is not working, its most simple and easy part of my project.
I know that its not made with PDO but i will redo it soon as i know whats wrong with it.
Code logic:
If user have taken order, accept.php changes status value from 0 to odottaa.
If second user takes same order before its being removed from the list, status=odottaa is TRUE and moves user back to kuljettaja.php
Currently if i run this file all i get is a blank answer from the database, no errors
<?php
require "secure/secure.php"; // Require login to page to prevent usage if not logged in
include "secure/config.php"; // Using database connection file here
$id = $_GET['id']; // get id through query string
$request = mysqli_query($link,"SELECT status FROM tilauskanta WHERE id=$id"); // Ask status value
echo "$request"; //Test print value
if ($request == "Odottaa"){
header("location:kuljettaja.php");
}
else{
header("location:accept.php?id=$id");
}
?>