If I run something very similar to your query through an online MySql sandbox (
MySQL online - Test SQL queries[
^]):
create table scientist1 (id integer, firstname varchar(100), lastname varchar(100));
insert into scientist1 (id, firstname, lastname) values (1, 'albert', 'einstein');
insert into scientist1 (id, firstname, lastname) values (2, 'isaac', 'newton');
insert into scientist1 (id, firstname, lastname) values (3, 'marie', 'curie');
create table scientist2 (id integer, firstname varchar(100), lastname varchar(100));
insert into scientist2 (id, firstname, lastname) values (1, 'albert', 'einstein');
insert into scientist2 (id, firstname, lastname) values (2, 'isaac', 'newton');
insert into scientist2 (id, firstname, lastname) values (3, 'marie', 'curie');
insert into scientist2 (id, firstname, lastname) values (4, 'marie', 'curie');
insert into scientist2 (id, firstname, lastname) values (5, 'marie', 'curie');
SELECT (SELECT COUNT(*) FROM scientist1) AS totalRecords1, (SELECT COUNT(*) FROM scientist2) AS totalRecords2
I get what I expect:
totalRecords1 totalRecords2
3 5
So ... the query works.
Start by checking your DB and the actual results you get, allow with the log entry to check for failure messages there.