我遇到T_encapsed_and_whitespace错误的问题

时间:2016-06-24 16:39:14

标签: php mysqli

我在第26行遇到错误(echo nl2br ...)但我无法弄清楚我哪里出错了。我收到了T_ENCAPSED_AND_WHITESPACE错误。

<!DOCTYPE>
<html>
<head>
<title>Update Data</title>
</head>
<body>
<?php 
$con=mysqli_connect("localhost","user","password","database");
if(mysqli_errno($con))
{
    echo "Can't Connect to mySQL:".mysqli_connect_error();
}
if(isset($_POST['Product']))
{
$name = $_POST['Product'];
$fetch="SELECT Product,'Part Code','A.k.a',Category,Description,Manual,DVI,VGA,HDMI,DisplayPort,'Dual Head','DVI Link','Max Resolution',USB,'PS/2',RS232,SUN,Options,'Audio I/O','USB Mode','USB ver','USB Speed',Isochronous,Ports,RJ45,SFP,IP6,'Real VNC','Default IP',Cable,'Max Distance',Adapter,POE,'USB/PS2',Users,Hosts,Firmware,Upgradeable,Method,Discontinued,Launched,Webpage FROM Products WHERE Product = '".$name."'";$result = mysqli_query($con,$fetch);
if(!$result)
{
echo "Error:".(mysqli_error($con));
}
//display the table
   echo  nl2br ("From Database \n\n");
  //while($data = mysqli_fetch_row($fetch))
while($row=mysqli_fetch_row($result)) 
   {
    echo nl2br ("Product: $row[0], \n\n Part Code: $row[1], \n\n A.k.a: $row[2], \n\n Category:  $row[3], \n\n Description:  $row[4], \n\n Manual  $row[5], \n\n DVI  $row[6], \n\n VGA  $row[7], \n\n HDMI  $row[8], \n\n DisplayPort  $row[9], \n\n Dual Head  $row[10], \n\n DVI Link  $row[12], \n\n Max Resolution  $row[13], \n\n USB  $row[14], \n\n PS/2  $row[15], \n\n RS232  $row[16], \n\n SUN  $row[17], \n\n Options  $row[18], \n\n Audio I/O  $row[19], \n\n USB Mode  $row[20], \n\n USB ver  $row[21], \n\n USB Speed $ row[22], \n\n Isochronous  $row[23], \n\n Ports  $row[24], \n\n RJ45  $row[25], \n\n SFP  $row[26], \n\n IP6  $row[27], \n\n Real VNC  $row[28], \n\n Default IP  $row[29], \n\n Cable  $row[30], \n\n Max Distance  $row[31], \n\n Adapter  $row[32], \n\n POE  $row[33], \n\n USB/PS2  $row[34], \n\n Users  $row[35], \n\n Hosts  $row[36], \n\n Firmware  $row[37], \n\n Upgradeable  $row[38], \n\n Method  $row[39], \n\n Discontinued  $row[40], \n\n Launched  $row[41], \n\n Webpage  $row[42], \n\n");
    }
}
?>
<br/>
<a href="test2.php"> Go back to Main Page </a>
</body>
</html>

0 个答案:

没有答案