title: PHP Error: Uncaught Error: Class 'mysql_connect' not found in /storage/ssd1/238/3211238/public_html/search.php
body: <p>I tried to make a search engine but i got a mysql/PHP error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Class 'mysql_connect' not found in /storage/ssd1/238/3211238/public_html/search.php:12 Stack trace: #0 {main} thrown in /storage/ssd1/238/3211238/public_html/search.php on line 12</p>
  </blockquote>
  
  <p>My Code:</p>
  
  <pre><code>&lt;?php
  $button = $_GET ['submit'];
  $search = $_GET ['search'];
  
  if (!$button)
      echo "you didn't submit a keyword";
  else {
      if (strlen($search) &lt;= 1)
          echo "Search term too short";
      else {
          echo "You searched for &lt;b&gt; $search &lt;/b&gt; &lt;hr size='1' &gt; &lt;/ br &gt; ";
          mysql_connect("localhost", "id3211238_base", "Rijk1234");
          mysqli_select_db("id3211238_data", "id3211238_base");
  
          $search_exploded = explode(" ", $search);
          $x = 0;
          foreach ($search_exploded as $search_each) {
              $x++;
              $construct = "";
              if ($x == 1)
                  $construct .= "keywords LIKE '%$search_each%'";
              else
                  $construct .= "AND keywords LIKE '%$search_each%'";
          }
  
          $construct = " SELECT * FROM SEARCH_ENGINE WHERE $construct ";
          $run = mysql_query($construct);
  
          $foundnum = mysql_num_rows($run);
  
          if ($foundnum == 0)
              echo "Sorry, there are no matching result for &lt;b&gt; $search &lt;/b&gt;. &lt;/br&gt; &lt;/br&gt; 1. Try more general words. for example: If you want to search 'how to create a website' then use general keyword like 'create' 'website' &lt;/br&gt; 2. Try different words with similar  meaning &lt;/br&gt; 3. Please check your spelling";
          else {
              echo "$foundnum results found !&lt;p&gt;";
  
              while ($runrows = mysql_fetch_assoc($run)) {
                  $title = $runrows ['title'];
                  $desc = $runrows ['description'];
                  $url = $runrows ['url'];
  
                  echo "&lt;a href='$url'&gt; &lt;b&gt; $title &lt;/b&gt; &lt;/a&gt; &lt;br&gt; $desc &lt;br&gt; &lt;a href='$url'&gt; $url &lt;/a&gt; &lt;p&gt;";
              }
          }
      }
  }
  ?&gt;
  </code></pre>