php中的print_r函数无法正常工作

时间:2015-08-07 11:29:44

标签: php mysql

我的代码

    $sql = "SELECT * FROM manifest WHERE (awb_no = '$var')";
    $result = mysql_query($sql);    
    while ($row = mysql_fetch_array($result))
    {
         $_SESSION['arr1'] = $row; 
    }
    print_r($_SESSION['arr1']);

当我以递归方式打印$_session时,它会打印两次获得的值,输出如下所示:

Array ( 
    [0] => 201505151312 
    [document_no] => 201505151312 
    [1] => FMPC1658606996 
    [awb_no] => FMPC1658606996 
    [2] => OD3028479929633865304 
    [order_id] => OD3028479929633865304 
    [3] => [forms] => 
    [4] => [extras] => 
)

如您所见,文档编号字段,awb_no字段等都打印两次。什么似乎是问题?

1 个答案:

答案 0 :(得分:1)

试试这个

(...).innerHTML = 'sometext'+'<div id=\"a\">word</div>'+obj.something+'othertext'; 解决您的问题

mysql_fetch_assoc
  

注意:自PHP 5.5.0起,此扩展程序已弃用,自PHP 7.0.0起已被删除