How can one get the table names from such a query using PHP and the query is run with MYSQLi
Example
SELECT table1.field1, table1.field2, table2.field3, table2.field4 FROM table1,table2
Result
array(table1,table2)
This is the code Im using but it only get the name of the first table
if (mysqli_num_rows($result) > 0) {
$numOfFields = mysqli_num_fields($result);
for ($i = 0; $i < $numOfFields; ++$i) {
$tableinfo = mysqli_fetch_field_direct($result, 1);
var_dump($tableinfo->orgtable);
}
}
Thanks in advance Im not so good at PHP
Thanks