Saturday 9 June 2018

php - Not sure what I am missing?

Could someone please help, I am not sure of what I am missing here.



This is the error I get:



Notice: Undefined index: post_id in C:\xampp\htdocs\projects\charlesprater\post.php on line 6






And this is my code as you can see below





$db = new Database();

$id = $_GET['post_id'];



$query = "SELECT * FROM posts WHERE post_id = $id";

$posts = $db->select($query) -> fetch_assoc();

$query = "SELECT * FROM catagory";

$catagory = $db->select($query);
?>














No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...