-1

我们正在使用此代码从数据库中检索数据,它显示了整个数据,但我也想检索 .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

请各位大侠帮帮我怎么解决?

4

1 回答 1

0

修正你的报价:

echo '<iframe src="' . $row['attachment'] . '"/>';
于 2013-09-05T19:19:07.197 回答