I'm moving an ancient site with a too-old-to-upgrade version of Wordpress plus some custom PHP code over to a newer server. I wasn't the one who created the site, and I'm trying to make the minimum changes necessary to get it working. Right now, it's throwing a MySQL error. Here's the query in question:
SELECT `wp_posts`.`post_title` as title, `wp_posts`.`post_date` as date, `wp_posts`.`post_name` as slug
    FROM `wp_posts`, `wp_categories`
    JOIN `wp_post2cat` ON `wp_posts`.`ID` = `wp_post2cat`.`post_id`
    WHERE wp_categories.cat_name = 'Stories'
    AND `wp_post2cat`.`category_id` = `wp_categories`.`cat_ID`
    ORDER BY date DESC
    LIMIT 0,10;
Pasting this query into PHPMyAdmin throws the following error:
#1054 - Unknown column 'wp_posts.ID' in 'on clause'
This clearly isn't the correct error, as wp_posts.ID does, in fact, exist, and the query worked on the old host (which was probably running an older version of MySQL).
So, since the error message is wrong, what's the real problem?
MySQL version: 10.2.13-MariaDB-10.2.13+maria~xenial - mariadb.org
Edit
In response to a comment, here's the structure of the tables in question:
CREATE TABLE `wp_posts` (
 `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `post_author` bigint(20) NOT NULL DEFAULT 0,
 `post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `post_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `post_content` longtext NOT NULL,
 `post_title` text NOT NULL,
 `post_category` int(4) NOT NULL DEFAULT 0,
 `post_excerpt` text NOT NULL,
 `post_status` enum('publish','draft','private','static','object','attachment','inherit','future') NOT NULL DEFAULT 'publish',
 `comment_status` enum('open','closed','registered_only') NOT NULL DEFAULT 'open',
 `ping_status` enum('open','closed') NOT NULL DEFAULT 'open',
 `post_password` varchar(20) NOT NULL DEFAULT '',
 `post_name` varchar(200) NOT NULL DEFAULT '',
 `to_ping` text NOT NULL,
 `pinged` text NOT NULL,
 `post_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `post_modified_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `post_content_filtered` text NOT NULL,
 `post_parent` bigint(20) NOT NULL DEFAULT 0,
 `guid` varchar(255) NOT NULL DEFAULT '',
 `menu_order` int(11) NOT NULL DEFAULT 0,
 `post_type` varchar(20) NOT NULL DEFAULT 'post',
 `post_mime_type` varchar(100) NOT NULL DEFAULT '',
 `comment_count` bigint(20) NOT NULL DEFAULT 0,
 PRIMARY KEY (`ID`),
 KEY `post_name` (`post_name`),
 KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=54 DEFAULT CHARSET=utf8
.
CREATE TABLE `wp_categories` (
 `cat_ID` bigint(20) NOT NULL AUTO_INCREMENT,
 `cat_name` varchar(55) NOT NULL DEFAULT '',
 `category_nicename` varchar(200) NOT NULL DEFAULT '',
 `category_description` longtext NOT NULL,
 `category_parent` bigint(20) NOT NULL DEFAULT 0,
 `category_count` bigint(20) NOT NULL DEFAULT 0,
 `link_count` bigint(20) NOT NULL DEFAULT 0,
 `posts_private` tinyint(1) NOT NULL DEFAULT 0,
 `links_private` tinyint(1) NOT NULL DEFAULT 0,
 PRIMARY KEY (`cat_ID`),
 KEY `category_nicename` (`category_nicename`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8
.
CREATE TABLE `wp_post2cat` (
 `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
 `post_id` bigint(20) NOT NULL DEFAULT 0,
 `category_id` bigint(20) NOT NULL DEFAULT 0,
 PRIMARY KEY (`rel_id`),
 KEY `post_id` (`post_id`,`category_id`)
) ENGINE=MyISAM AUTO_INCREMENT=166 DEFAULT CHARSET=utf8