I will preface this by saying I've been stuck on this for a couple days, I am obviously new and know I'm missing something simple. I've tried so many ways. Security is not an issue yet and I am just trying to learn on my own server.
I always get 'something found' even when I know the value does not exists. I am trying to enter a phrase into an input field, press submit and see if the value already exists in the table
Sorry for the dumb question.
<?php error_reporting(E_ALL); ini_set('display_errors', 1); // error_reporting(0); // ini_set('display_errors', 0); // exit(); //echo '<pre>'; print_r($user_info); echo '</pre>'; if ( (isset($_POST['lookup'])) && ($_REQUEST['lookup'] =='1')) { echo 'you\'ve entered a keyword, lets see if it exsists!'; $looksql = "SELECT * FROM `crm3`.`keywords` WHERE `KW0` LIKE '".$_POST['lookup']."' ORDER BY `ID` ASC "; if ($result = mysqli_query($db, $looksql)) { echo '<br>someting found'; } else { echo '<br>nothing found'; } } else { echo '<br>please enter a keyword to start the search'; } ?> <br><br><br> <form method="POST" action="./?action=kwcheck"> <input type="hidden" name="lookup" value="1" /> keyword lookup: <input type="text" name="keyword" /><br> <input type="submit" value="SEARCH" />