如何使用php在网页上显示phpMyAdmin的.doc / pdf文件?

时间:2013-09-05 19:15:25

标签: php phpmyadmin

我们正在使用此代码从数据库中检索数据,显示整个数据,但我想检索.doc附件,但它没有显示..

<?php

 $con = mysql_connect("your.hostname.com","abc","abc");



mysql_select_db("car1319108511185",$con);
$query = "SELECT * FROM  `wp_rsjp_submissions` LIMIT 0 , 30";
$comments = mysql_query($query);
echo "<h1> Applications </h1>";

while($row = mysql_fetch_array($comments, MYSQL_ASSOC))
{
    $name = $row['fname'];
    $lname = $row['lname'];
    $address1 = $row['address'];
    $address2 = $row['address2'];
    $city = $row['city'];
    $state = $row['state'];
    echo '<iframe src='$row['attachment']'/>';




    echo "<div style='margin:30px 0px;'>
        First Name: $name<br/>
        Last Name : $lname<br/>
        Address : $address1<br/> $address2<br/>
        City : $city <br/>
        State : $state <br/>

         <br/>
        </div>";

        }


        mysql_close($con);

        ?>

它显示第20行的错误:

  Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/content/48/11655748/html/display_comments.php on line 20

请帮助我们如何解决它?

1 个答案:

答案 0 :(得分:0)

修正你的报价:

echo '<iframe src="' . $row['attachment'] . '"/>';