I'm wanting to search database for existing strings when typing into a <input>
I currently have this input code:
<input type="text" name="rules_data_imdb_id" value="" id="elInput_rules_data_imdb_id">
With this PHP:
$mysqli = new mysqli(localhost, username, password, database);
$result = $mysqli->query("SELECT id FROM rules_data_videobox_video WHERE data_imdb_id = '#elInput_rules_data_imdb_id'");
if($result->num_rows == 0) {
echo "<h2>exists</h2>";
} else {
echo "<h2>nah</h2>";
}
$mysqli->close();
However I'm just splicing together bits and bobs what I've seen on the internet as I rarely use PHP i'm not familiar with it.