I am developing a License manager plugin but not able to search data from my wordpress custom table. Please help !!
table ITEMs are licence_id, product_id, licence_code, licence_status, activation_date, creation_date,
<form method="post">
<label><?php _e('Input License here : '); ?></label>
<input type="text" name="codename" />
<button type="submit" name="submit" class="submit button"><?php _e('Verify Now'); ?></button><br>
</form>
<?php
if (isset($_POST['submit'])){
$code_qr = $_POST["codename"];
global $wpdb;
$query = "SELECT licence_code FROM {$wpdb->prefix}wc_product_licences WHERE licence_code = '$code_qr'";
$lic_codes = $wpdb->get_var($query);
if ($lic_codes == $code_qr) {
echo "<p>Your License : ".$lic_codes. " is Valid</p>";
}else{
echo"Sorry!! No License match with your query";
}
}
?>