title: Search Query Didn't Work Well
body: <p>I got a problem will using the search. I want to show it like this if I didn't put a word:</p>
  
  <pre><code>Not found
  </code></pre>
  
  <p>And the code is like this:</p>
  
  <pre><code>&lt;?php
      error_reporting(0);
  
      $search = trim($_POST["search"]);
      $search = htmlentities(htmlspecialchars($search), ENT_QUOTES);
  
      $select = "SELECT * FROM articleWHERE article_title LIKE '%" . $search . "%' ORDER BY id_artikel DESC LIMIT 12";
      $query = mysql_query($select);
      $num = mysql_num_rows($query);
  
      if ($num &gt; 0) {
          while ($fetch = mysql_fetch_array($query)) {
                  echo '&lt;div class="row"&gt;';
                  echo '    &lt;div class="col-md-4"&gt;';
                  echo '        &lt;div class="news-post standard-post2"&gt;';
                  echo '            &lt;div class="post-gallery"&gt;';
                  echo '                &lt;img src="#" alt=""&gt;';
                  echo '                &lt;a class="category-post world" href="#"&gt;Business&lt;/a&gt;';
                  echo '            &lt;/div&gt;';
                  echo '            &lt;div class="post-title"&gt;';
                  echo '                &lt;h2&gt;&lt;a href="#"&gt;' . $fetch["article_title"] . '&lt;/a&gt;&lt;/h2&gt;';
                  echo '                &lt;ul class="post-tags"&gt;';
                  echo '                    &lt;li&gt;&lt;i class="fa fa-clock-o"&gt;&lt;/i&gt;' . date("d F Y") . '&lt;/li&gt;';
                  echo '                    &lt;li&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;by &lt;a href="#"&gt;' . $fetch["writer"] . '&lt;/a&gt;&lt;/li&gt;';
                  echo '                    &lt;li&gt;&lt;a href="#"&gt;&lt;i class="fa fa-comments-o"&gt;&lt;/i&gt;23&lt;/a&gt;&lt;/li&gt;';
                  echo '                    &lt;li&gt;&lt;i class="fa fa-eye"&gt;&lt;/i&gt;' . $fetch["read"] . '&lt;/li&gt;';
                  echo '                &lt;/ul&gt;';
                  echo '            &lt;/div&gt;';
                  echo '            &lt;div class="post-content"&gt;';
                  echo '                &lt;p&gt;' . substr(strip_tags($fetch["content"]), 0, 150) . "..." . '&lt;/p&gt;';
                  echo '                &lt;a href="artikel.php" class="read-more-button"&gt;&lt;i class="fa fa-arrow-circle-right"&gt;&lt;/i&gt;Read More&lt;/a&gt;';
                  echo '            &lt;/div&gt;';
                  echo '        &lt;/div&gt;';
                  echo '    &lt;/div&gt;';
                  echo '&lt;/div&gt;';
           }
       } else {
            echo '&lt;p align="center"&gt;Not Found&lt;/p&gt;';
       }
  ?&gt;
  </code></pre>
  
  <p>If I didn't put a word on the search form it didn't show the "not found". Please let me know how I go about doing it.</p>