Code error when submitting search query
<p>I'm getting error on this:</p>

<blockquote>
  <p>Deprecated: Function split() is deprecated in C:\xampp\htdocs\tet\search_motifasni2.php on line 10</p>
  
  <p>Notice: Undefined variable: sql in C:\xampp\htdocs\tet\search_motifasni2.php on line 18</p>
  
  <p>Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\tet\search_motifasni2.php on line 32
  doc with term: </p>
</blockquote>

<p>Codes:</p>

<pre><code>if (isset($_POST['Submit']))
{

        //retrieve search word, trim, remove duplicate
        $find = $_POST['find'];
        $find = ltrim($find);
        $find = rtrim($find);
        $find = split(" ",$find);//line 10
        $find = array_unique($find); 
</code></pre>

<p>. . .</p>

<pre><code>        if($val&lt;&gt;" " and strlen($val)&gt;0)
        {
            $sql .=" Terms = '$val' or";//line 18
        }
    }
</code></pre>

<p>. . .</p>

<pre><code>    $query = "SELECT * FROM document";
    $result = mysql_query($query);
    $num = mysql_num_rows($result);//line 32
</code></pre>

<p>Tried many ways but still getting the same result when searched a query.</p>
