我试图从公司列表中回显。 但我不能摆脱单引号? 我发现了很多的这些问题已经在线,但没有工作......PHP/MySQLremove单引号形式回声
<div class="form-group">
<div class="col-sm-12">
<label>Kunde</label>
<?php
$username = $_SESSION['username'];
$useractive = $_SESSION['id'];
$query = "SELECT DISTINCT user.id, customer.customer_id, customer.customer_name
FROM user JOIN customer ON user.id = customer.customer_id
WHERE customer.customer_id=$useractive
ORDER BY customer.customer_id";
$result = mysqli_query($dbc, $query) or die(mysqli_error($dbc));
?>
<select type="text" class="form-control" name="timer_kunde">
<option></option>
<?php
$row = str_replace("'", "", $query);
while ($row = mysqli_fetch_array($result))
{
echo "<option value='".$row['customer_name']."'>'".$row['customer_name']."'</option>";
}
?>
</select>
</div>
</div>
,我也想知道,为什么回声仅在“CUSTOMER_NAME”是设置双倍的努力? 它只能回应一次这个代码。
在此先感谢!
把你的串码在问题 – Swellar
为什么你更换$查询变量单引号? – JYoThI