I was making search page use in PHP. But that is a error. Please tell me my error.
The errors are:
Notice: Undefined variable: post_title in I:\xampp\htdocs\tsooj\includes\search_page.php on line 22
Notice: Undefined variable: post_content in I:\xampp\htdocs\tsooj\includes\search_page.php on line 26
Source code is here:
<div id="content-main">
<?php
include("includes/connect.php");
if(isset($_GET['search'])){
$search_id = $_GET['value'];
$search_query = "select * from posts where post_keywords like '%$search_id%'";
$run_query = mysql_query($search_query);
while ($search_row = mysql_fetch_array($run_query)){
$post_title = $search_row['post_title'];
$post_image = $search_row['post_image'];
$post_content = substr($search_row['post_content'],0,150);
}
?>
<h1>Your Search Result is here:<h1>
<h2><?php echo $post_title; ?></h2>
<img src="images/<?php echo $post_image; ?>">;
<p><?php echo $post_content; ?></p>
<?php } ?>
</div>