prefix . "add_custom_link"; if($_POST['add_link']=='Y'): $id = $_POST['custom_link_id']; $title = $_POST['custom_link_title']; $parent = $_POST['custom_link_parent']; $href = $_POST['custom_link_href']; $query = "SELECT * FROM $table_name where id='$id'"; $results_new = $wpdb->get_results($query); $check_counter=count($results_new); if($check_counter>0){ echo '