首页 > 解决方案 > 当查询包含双引号并出现在超链接内时,PHP 不显示查询的值

问题描述

我正在向 mysql 发送一个简单的查询以获取两个字段并将它们回显到表中:

<?php 
$sql = "SELECT `Data`, `Cerca` FROM `llengua-cerques` ORDER BY `llengua-cerques`.`Data` DESC LIMIT 10;" ; }

$result = mysqli_query($app_db, $sql);
while ($aRow = mysqli_fetch_array($result)) {

cerca = $aRow['Cerca'];
$cerca = stripslashes($cerca); ?>

<li><a href="/llengua/resultats.php?cerca=<?php echo $cerca; ?>"><strong><?php echo strftime( '%d/%m/%y', strtotime( $aRow['Data'] ) ); ?></strong><?php echo $cerca; } ?></a></li>

它工作正常,但是这段代码什么时候:

它显示为空。

我解决不了...

标签: phpmysqlhyperlinkdouble-quotes

解决方案


推荐阅读