check if row allredy exists : I want to check in my sql table if row allredy existes.
I want to save data if he is not existes in my table. I'm using in selsect qurey but it dosent worked

this is my code:

    $sql = "INSERT INTO searchtable (word, position, count) VALUES (:word , :position, :count)";
    
    $statement = $db->prepare($sql);
    
    
    $temp="SELECT COUNT(word) AS searchtableFromword FROM  searchtable WHERE word=$title" ;
    
    echo mysql_num_rows($temp);
    
    if($checkTitle == 0 )
    {
        $statement->execute(array(
            'word' => $title,
            'position' => $fileNum,
            'count' => $titleVal
        ));
    }