0

我正在尝试检索已成功保存在 mysql db 中的 pdf 和 doc 文件,并让用户可以访问它。但这就是我得到userimages/1364700305.30527.pdf的。检索文件的代码如下:

<?php
if (isset($_GET['svreg'])) {
    $svreg = $_GET['svreg'];
    $query = "
      SELECT image_file, note_title, note_commt
      FROM notez
      WHERE svreg = '$svreg'
    ";
    $result = mysql_query($query) or die('Error, query failed');
    list($image_file, $note_title, $note_commt) = mysql_fetch_array($result);
}
?>
<a href="veh_over_view.php?svreg=<?=$svreg;?>"><?=$image_file;?></a> <br> 

是的,我在 db 中有完整路径。

4

1 回答 1

0

你没有很好地解释你想要什么所以这就是我理解你想要的

    <?php
    if (isset($_GET['svreg'])) {

        $svreg = $_GET['svreg'];

        $query = "
          SELECT image_file, note_title, note_commt
          FROM notez
          WHERE svreg = '".$svreg."'
        ";

        $result = mysql_query($query) or die('Error, query failed');

        while(list($image_file, $note_title, $note_commt) = mysql_fetch_array($result)){ ?>

             <a href="veh_over_view.php?svreg=<?=$svreg;?>"><?=$image_file;?></a> <br> 

    <?php }

    }?>
于 2013-08-28T09:23:05.197 回答