I am trying to fetch one array from an Oracle database and another from a MySQL database.
But the arrays I get back are in different formats, and I am not able to display them in an HTML table.
$result = $instance->prepare("SELECT * from dd ");
$result->execute();
while ($row = $result->fetchAll(PDO::FETCH_ASSOC))
{
$rows2 = $row;
}
$array = oci_parse($conn, "SELECT * FROM DD");
oci_execute($array);
while($row=oci_fetch_array($array, OCI_ASSOC))
{
$rows1 =$row;
}
print_r($rows1);
print_r($rows2);
$output = array_merge($rows1,$rows2);
print_r($output);
Here $instance
and $conn
are the respective connection variables.
The outputs I get after printing the two arrays are:
Array from Oracle:
Array ( [CLIENTID] => 2 [CLIENTNAME] => dsd [PHONENO] => 53556535 [ADDRESS] => Mumbai [ROUTE] => 4323 )
Array from MySQL:
Array ( [0] => Array ( [ClientId] => 3 [ClientName] => PQR [PhoneNo] => 786483744 [Address] => Pune [Route] => 3329 ) )
And after merging I get this array:
Array ( [CLIENTID] => 2 [CLIENTNAME] => dsd [PHONENO] => 53556535 [ADDRESS] => Mumbai [ROUTE] => 4323 [0] => Array ( [ClientId] => 3 [ClientName] => PQR [PhoneNo] => 786483744 [Address] => Pune [Route] => 3329 ) )
How do I print this in a table in HTML format?