Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何显示包含'&';价值_Php_Mysql - Fatal编程技术网

Php 如何显示包含'&';价值

Php 如何显示包含'&';价值,php,mysql,Php,Mysql,在我的mysql表中,有一些记录需要检索并在页面中显示,但我的表有一个名为company的列,当我被查询并显示这些值时,它包含一个名为AT&T的值,而不是仅显示AT&T的值。如何解决这个问题 这是我试过的 update tests set stages=\"$stages\", channel=\"$channel\", remarks=\"$remarks\",owner=\"$owner\",date1=\"$modified_on\",action_item=\"$acti‌​on_ite

在我的mysql表中,有一些记录需要检索并在页面中显示,但我的表有一个名为company的列,当我被查询并显示这些值时,它包含一个名为AT&T的值,而不是仅显示AT&T的值。如何解决这个问题

这是我试过的

update tests set stages=\"$stages\", channel=\"$channel\", remarks=\"$remarks\",owner=\"$owner\",date1=\"$modified_on\",action_item=\"$acti‌​on_item\" where (organization=\"$organization\" && id=\"$rider_id\" && first_name=\"$first_name\")";

这是我用于根据公司名称进行更新的命令,但是由公司名称中的和组成的值不会更新

您需要转义值。例如,如果您正在使用mysqli:

    //escape and htmlspecialchars
    $stages = mysqli_real_escape_string($link, htmlspecialchars($stages));
    $channel= mysqli_real_escape_string($link, htmlspecialchars($channel));
    etc...

@Avidan我已更新问题更新不显示,请选择“是”。我不知道这是怎么回事。@Fred ii基于更新声明,我应该显示thera没有必要对此投反对票。如果你没有想法,那就不要评论。老兄,如果你想指控我什么,那就是想帮我。现实一点。再说,“它不起作用”也没什么好谈的。祝你好运。如果你在HTML中显示你的结果,你可以将特殊字符如&改为HTML格式。。。因此&将是&;。也许这是你的问题。