How PHP finds information in the same row in another database according to the specified information.
The database has been built TB_XMPC, only two columns, one column is xmpc_id, one column is xmpc_expr, now I want to follow the xmpc_id information extracted from the Web page to get the corresponding xmpc_expr column information, set as the default option, I do not know why always can not display the query results, To the heroes of the road to ask!
The corresponding code is as follows:
Find the batch description corresponding to the batch ID
$query 2=mssql_query ("select * from TB_XMPC where xm_pcid= ' $xmpc _id '");
$myrow 2=mssql_fetch_array ($query 2);
$old _pc= $myrow 2[xmpc_expr];
?>
Share to:
------Solution--------------------
How are you going to output the array?
$query 2=mssql_query ("select * from TB_XMPC where xm_pcid= ' $xmpc _id '");
$temp =array ();
while ($myrow 2=mssql_fetch_array ($query 2)) {
Array_push ($temp, $myrow 2[' XMPC_ECPR ');
}
------Solution--------------------
$old _pc not a single value?
Change to this:
------Solution--------------------
Do you need a query two times?
Change it to the following:
!--? php $query 2=mssql_que Ry ("SELECT * from TB_XMPC"); while ($myrow 2=mssql_fetch_array ($query 2)) {$selected = $myrow 2[xmpc_id]== $xmpc _id? ' selected= ' selected "': '; ?> >!--? php echo $myrow 2[xmpc_e XPR];? --> !--? php