Understanding custom php that reads from WP MYSQL

Have you looked at the server log files (MySQL and PHP)? It could be several things:

  • A MySQL permission issue on the db and/or table
  • Table is named differently than stated in your code
  • MySQL and/or WordPress are using older versions that don’t support certain syntax