Database used in PHP code is outdated in PHPMyAdmin
-
Hope this is the right forum – I didn’t find one for databases.
I have an intermittent problem. I have PHP code that checks a member database for expiration dates and sends a reminder when the expiration date has arrived. This code has been working for several years but now fails intermittently. For example, of two member records with the same expiration date of 12/30/2017, one is found and one is not.
The code which checks the ‘dateexpire’ column:
$members = $wpdb->get_col( " SELECT um.user_id FROM {$wpdb->usermeta} um WHERE um.meta_key = 'dateexpire' AND DATE(um.meta_value) = (DATE_ADD(curdate(), INTERVAL +0 DAY)) ");
I inherited this code from a previous webmaster and I admit I don’t fully understand what it’s doing. It seems to be referencing the usermeta table, however the wp_users table with the dateexpire column is in a custom database, separate from the default wp database. When I look at the database in PHPMyAdmin to check the values, I log in with the same username and password used by the PHP code. But when I look at the wp_users table, it is way out of date – the last update was in 2014 and I know that many updates have been made since then. I can export the same table from my PHP page and I get the current values.
Is there a hidden version of MySQL databases?
- The topic ‘Database used in PHP code is outdated in PHPMyAdmin’ is closed to new replies.