Data is not constantly loading from custom wordpress table

First of all your code is unsafe. Need to add the sanitize functions and the escaping query to the database

global $wpdb;
$tablename_temp = $wpdb->prefix . 'faculty_temp';
$toke = isset( $_GET['token'] ) ? sanitize_text_field( wp_unslash( $_GET['token'] ) ) : '';
$user = $wpdb->get_results("SELECT * FROM $tablename_temp where token='".$wpdb->esc_like($toke)."'");

The code is valid. Perhaps the problem is that you are simultaneously writing and deleting to the temporary table “faculty_temp” and the fetch request is sent when data is deleted or modified.

Need to change your method for working with temp data

Leave a Comment