I need some help with my project, when i type in textbox (primary key - textbox), if it is duplicated key in mysql, it will show text next to textbox like this (not click button, it will show auto when i type: ABC12444 -> this record is exist in system):
My code:
$idcustomer = $_POST['txtIDCus'];
$result = $mysqli->query("SELECT * FROM customer where id='$idcustomer' ");
if ($result->num_rows > 0) {
$errMsg="Key exist in system";
}
Simple HTML Code
<b>ID Customer:</b>
<input type="text" id="txtIDCus" name="txtIDCus" width="100" placeholder="Type ID Customer" size="40" class="form-control" maxlength="70"/> <br />
I try to show my stuck, hope you help me. Thanks!