Ah, my bad: seems like the PHP manual's search functionality for functions that are aliases is broken.
I am not sure if mysqli_fetch_field_direct is the right tool for the job, but I do not have a MySQL database available to find out for myself, so I shall make do with your attempt. For starters, I note that your SQL statement has a typo error: "MyDatabase" should have been "
MyDatabase". You should therefore fix it and check for further errors, e.g.,
[code=php]$sql = "SHOW TABLES FROM
MyDatabaseWHERE
Tables_in_MyDatabase` IN ('tableone', 'tabletwo', 'tablethree')";
$result = mysqli_query($db, $sql) or die(mysqli_error($db));
$total_tables = mysqli_num_rows($result);
for ($i = 0; $i < $total_tables; ++$i) {
echo mysqli_fetch_field_direct($result, 0)->table;
}[/code]
I have chosen to change $i to 0 in the mysqli_fetch_field_direct call since SHOW TABLES should only produce a result set with one column. But here's where mysqli_fetch_field_direct does not seem like the right tool for the job: calling it for each row does not make sense, since it is concerned with a field of the result set irrespective of row (i.e., a column). Perhaps you should try mysqli_fetch_row in a loop instead.