Wednesday 21 December 2016

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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...