How to check if token already exists in database table : <p>I stuck with this,</p>

<p>show an error if the token is already exists in the database table, 
and if there is no token in database table this will show success message for example</p>

<pre><code>$token = cleanfrm($_REQUEST['t']);
$user = $user_info['id'];
$ad_info = $db-&gt;fetchRow(("SELECT * FROM video WHERE token='" . $token . "'"));

$logs_info = $db-&gt;fetchRow(("SELECT token FROM video_ WHERE uid='" . $user . "'"));
if ($logs_info = " . $ad_token . ") {
$error_msg = "&lt;div class='message'&gt;you already watch this video &lt;/div&gt;";
}else {
$error_msg = "&lt;div class='message'&gt;Click here to watch &lt;/div&gt;";
}
</code></pre>
