Php 在a中显示mysql表中的数据<;span>;

Php 在a中显示mysql表中的数据<;span>;,php,html,mysql,Php,Html,Mysql,我试图在a中的a中显示mysql表中的数据,但在echos中出现语法错误,我开始显示$data,我真的不明白为什么,下面是代码: while ($data = mysql_fetch_array($req)) { echo'<div class="row">'; echo'<input type="radio" name="expand">'; echo '<span class="cell primary" data-label="Date"&

我试图在a中的a中显示mysql表中的数据,但在echos中出现语法错误,我开始显示$data,我真的不明白为什么,下面是代码:

while ($data = mysql_fetch_array($req)) {
  echo'<div class="row">';
    echo'<input type="radio" name="expand">';
    echo '<span class="cell primary" data-label="Date">'$data['date']'</span>';
   echo'<span class="cell" data-label="Titre"> <a href="read_msg.php?id_msg_usr='$data['id_msg_usr']'"> </span>';
     echo'<span class="cell" data-label="Fromm">'stripslashes(htmlentities(trim($data['fromm'])))'</span>';
  echo'</div>';
while($data=mysql\u fetch\u数组($req)){
回声';
回声';
回显“$date['date']”;
回声';
echo“条纹斜线(htmlentities(trim($data['fromm'))))”;
回声';

谢谢你的帮助

你忘了在这么多地方画点

while ($data = mysql_fetch_array($req)) {
    echo '<div class="row">';
    echo '<input type="radio" name="expand">';
    echo '<span class="cell primary" data-label="Date">'.$data['date'].'</span>';
    echo '<span class="cell" data-label="Titre"> <a href="read_msg.php?id_msg_usr='.$data['id_msg_usr'].'"> </span>';
    echo '<span class="cell" data-label="Fromm">'.stripslashes(htmlentities(trim($data['fromm']))).'</span>';
    echo'</div>';
}
while($data=mysql\u fetch\u数组($req)){
回声';
回声';
回显'.$data['date'].';
回声';
回显“”。条带斜杠(htmlentities(trim($data['fromm'))))。';
回声';
}

您缺少一些连接点(
)和一个右括号

用于避免此类错误,即:

while ($data = mysql_fetch_array($req)) {
$fromm = stripslashes(htmlentities(trim($data['fromm'])));
$id_msg_usr = $data['id_msg_usr'];
echo <<< LOL
<div class="row">
   <input type="radio" name="expand">
   <span class="cell primary" data-label="Date">{$fromm}</span>
   <span class="cell" data-label="Fromm">{$id_msg_usr}</span>
</div>
LOL;
}
while($data=mysql\u fetch\u数组($req)){
$fromm=stripslashes(htmlentities(trim($data['fromm'])));
$id_msg_usr=$data['id_msg_usr'];

echo,语法错误是……?$data['date']insert'到top和finish并插入}请在PHP 7中删除。请学习使用PDO的语句,并考虑使用PDO。谢谢你的建议。我将尝试阅读并了解更多。非常感谢,它现在工作得很好。我对这一点还很陌生,我试着尽可能多地从例子中学习,但有时我会碰到这样的墙:rint,如果这个答案对您有帮助,您可以点击复选标记接受它。