我的一个one.php页面下:
<?php
include("conn.php");
$rs=mysql_query("
 (
  select op_values from table1 where op.id=11
  )union
 ( 
   select op_values from table2 where op.id=12
)
     
 
 while($row=mysql_fetch_array($rs))
{  
 echo "$row[op_values]<br/> ";
  
           }
  
 ?>
two.php页面下:
<?php
include("conn.php");define('ID_OUTPUT_VOLTAGE', 31);
define('ID_OUTPUT_CURRENT', 35);$V = getProductAttributes(ID_V, $p_id);
$A = getProductAttributes(ID_A, $p_id);function getProductAttributes(){
这里面不会写呢,想把sql的两个值op_values给弄过来,echo 出来
}然后w=V*A;

解决方案 »

  1.   

    two.php页面把one.php页面的sql下的op_values值给弄过来
      

  2.   

    while($row=mysql_fetch_array($rs))
    {  
        // echo "$row[op_values]<br/> ";  //如果只是为了传值就不用输出
         $arr[]= $row[op_values]; }two.php包含one.php,就可以用$arr数组了。
    当然你也可以使用session传值。
      

  3.   

    呵呵,我想在function里面获取了,不过还是谢谢了。
      

  4.   

    two.php包含one.php,就可以用$arr数组了。
    当然你也可以使用session传值。??不理解,可以说得更细点么