php echo也显示分号

时间:2015-07-24 08:37:57

标签: php html json database echo

php echo正在替换分号,假设这样结束回声:

这是代码

   <html>
<head>
    <style>


    </style>
<link rel='stylesheet' type='text/css' href='main2.css' />
</head>
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "movie_db";
$srchq = $_POST['srch'];

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
     die("Connection failed: " . $conn->connect_error);
} 
$srchq = preg_replace("#[^0-9a-z]#i", "", $srchq);

$sql = "SELECT * FROM `movie_db` WHERE `title` LIKE '%$srchq%' OR `sr_no` LIKE '%$srchq%' ";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
     echo "<p1>";
     // output data of each row
     while($row = $result->fetch_assoc()) 

         echo ("<a href=".$row["movie"]."><img src =" . $row["poster"]. "></a></p1><p2><b><a href=" .$row["movie"].">" . $row["title"]. "</a></b></p2><br><p3><b>Duration : </b>".$row["Duration"]." Mins</p3> ;&nbsp<p3><b> Views : </b> ".$row["views"]."</p3><br><div><p3><b>Description :</b>".$row["descrip"]."</p3></div><br>");
 mysql_close(mysql_connect($servername, $username, $password));
}
else {
     echo "0 results";
}?>
</body>
</html>

如果有人能告诉我为什么会发生这种情况会有所帮助。

似乎分号出现了

echo ("<a href=".$row["movie"]."><img src =" . $row["poster"]. "></a></p1><p2><b><a href=" .$row["movie"].">" . $row["title"]. "</a></b></p2><br><p3><b>Duration : </b>".$row["Duration"]." Mins</p3> ;&nbsp<p3><b> Views : </b> ".$row["views"]."</p3><br><div><p3><b>Description :</b>".$row["descrip"]."</p3></div><br>");

1 个答案:

答案 0 :(得分:6)

我认为错误是;&amp; nbsp在末尾加分号

void YourClass :: myReceivedData()
{
    QByteArray readData= serial->readAll();
    qDebug() << readCurData;   // Here I am printing the received Serial Data
}