Can you add some code to check the results of $sql3 to verify that it contains table 'test'.