php回显和反斜杠
为了我的生活,我不能让这个工作php回显和反斜杠,php,echo,Php,Echo,为了我的生活,我不能让这个工作 if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "<a href=\"concert.php?id=. $row["id"] .\">. $row["date"] .</a>" "<br>"; } if($result->num\u rows>0){ //每行
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<a href=\"concert.php?id=. $row["id"] .\">. $row["date"] .</a>"
"<br>";
}
if($result->num\u rows>0){
//每行的输出数据
而($row=$result->fetch_assoc()){
回声“”
“
”;
}
这就是错误
语法错误,意外“”,应为标识符(T_字符串)或
变量(T_变量)或数字(T_NUM_字符串)
我相信你只是在html中添加了转义“你缺少了一些结束和开始的引号。用单引号替换一些双引号也将不需要这些反斜杠
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<a href="concert.php?id=' . $row["id"] . '">' . $row["date"] . '</a><br>';
}
if($result->num\u rows>0){
//每行的输出数据
而($row=$result->fetch_assoc()){
回声“
”;
}
$row[“id”]。
=>“$row[“id”]。”
或“id={$row[“id”]}”