Notice: Undefined variable: the_post_id in C:\xampp\htdocs\renda\post.php on line 27
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\renda\post.php on line 30
This is line 27
$query ="SELECT * FROM posts WHERE post_id = {$the_post_id}";
This is line 30
while ($row = mysqli_fetch_assoc($select_all_posts_query)) {
This is my PHP Code
<?php
if(isset($_GET['p_id'])) {
$the_post_id = $_GET['p_id'];
}
$query ="SELECT * FROM posts WHERE post_id = {$the_post_id}";
$select_all_posts_query = mysqli_query($connection, $query);
while ($row = mysqli_fetch_assoc($select_all_posts_query)) {
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$post_author = $row['post_author'];
$post_date = $row['post_date'];
$post_image = $row['post_image'];
$post_content = $row['post_content'];