title: Notice: Undefined variable: in PHP
body: <p>I was making search page use in PHP. But that is a error. Please tell me my error.</p>
  <p>The errors are:</p>
  <blockquote>
  <p>Notice: Undefined variable: post_title in I:\xampp\htdocs\tsooj\includes\search_page.php on line 22</p>
  <p>Notice: Undefined variable: post_content in I:\xampp\htdocs\tsooj\includes\search_page.php on line 26</p>
  </blockquote>
  <p>Source code is here:</p>
  <pre><code>&lt;div id=&quot;content-main&quot;&gt;
      &lt;?php
      include(&quot;includes/connect.php&quot;);
      
      if(isset($_GET['search'])){
      
      $search_id = $_GET['value'];
      
      $search_query = &quot;select * from posts where post_keywords like '%$search_id%'&quot;;
      
      $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);
      }
      ?&gt;
  &lt;h1&gt;Your Search Result is here:&lt;h1&gt;
  
  &lt;h2&gt;&lt;?php echo $post_title; ?&gt;&lt;/h2&gt;
  
  &lt;img src=&quot;images/&lt;?php echo $post_image; ?&gt;&quot;&gt;;
  
  &lt;p&gt;&lt;?php echo $post_content; ?&gt;&lt;/p&gt;
  
  &lt;?php } ?&gt;
      
  &lt;/div&gt;
  </code></pre>