[stackoverflow] [progress Openedge Abl] 2 Odbc Queries Into One Html Table Using Php

Status
Not open for further replies.
U

user3284404

Guest
I'm trying to acccess data from 2 separate ODBC connections; one from a MySQL database, the other from PROGRESS and I would like to compare data from the two and output to an HTML table. Here is my code as is at the minute which doesn't work obviously. Any and all help appreciated:

<?php

//select data from MySQL.
$sql = "SELECT
*
FROM quotation
WHERE order_no IN ('$order_no')
ORDER BY order_no, order_line ASC
";
$rs = odbc_exec($mysqlconn, $sql);


//select data from MFG-PRO.
$sql2 = "SELECT
sod_nbr,
sod_line,
sod_qty_ord,
sod_std_cost
FROM sod_det
WHERE sod_nbr IN ('$order_no')
ORDER BY sod_nbr, sod_line ASC
";
$rs2 = odbc_exec($oconn, $sql2);


// build array
while($row1=odbc_fetch_array($rs) && $row2=odbc_fetch_array($rs2))
{

echo '<tr>
<td><input type="text" name="quotation[]" value="'.$row1['idquotation'].'" readonly/></td>
<td><input type="text" name="order_no[]" value="'.$row1['order_no'].'" readonly/></td>
<td><input type="text" name="order_date[]" value="'.$row1['order_date'].'" readonly/></td>
<td><input type="text" name="customer[]" value="'.$row1['customer'].'" readonly/></td>
<td><input type="text" name="order_line[]" value="'.$row1['order_line'].'" readonly/></td>
<td><input type="text" name="part[]" value="'.$row1['part'].'" readonly/></td>
<td><input type="text" name="order_qty[]" value="'.$row1['order_qty'].'" readonly/></td>
<td><input type="text" name="standard_cost[]" value="'.$row1['standard_cost'].'" readonly/></td>
<td><input type="text" name="created_by[]" value="'.$row1['created_by'].'" readonly/></td>
';

echo '
<td><input type="text" name="sod_line[]" value="'.$row2['sod_line'].'" readonly/></td>
<td><input type="text" name="sod_qty_ord[]" value="'.$row2['sod_qty_ord'].'" readonly/></td>
<td><input type="text" name="sod_std_cost[]" value="'.$row2['sod_std_cost'].'" readonly/></td>
<td><input type="text" name="valid[]" value="';

echo ''.'" readonly/></td>';

}


?>

Continue reading...
 
Status
Not open for further replies.
Top