I am trying to create a mysql query where it echo out the files from the database. Here, I want the computer to echo out the detail of the file if there is such id number input by user whereas if there is no such id number of the file then it has to echo out HTTP 404 error code.
I have used this code at the top of the page.
<?php
http_response_code(404);
?>
The above code says Call to undefined function http_response_code()
And also when I use this code in something like if statement true then echo or if false then http_response code. It doesn't work.