Home > Backend Development > PHP Tutorial > 求助MYSQL查询问题

求助MYSQL查询问题

WBOY
Release: 2016-06-23 14:16:35
Original
816 people have browsed it

$name_addslashes = addslashes($name);
$artname_addslashes = addslashes($artname);
$test = 'SOUL & BOSSA';
echo $name_addslashes;
echo $test;
$songnamefromartist = "select * from Song where AlbName='$name_addslashes'";

2个echo显示出来的都一样(SOUL & BOSSA),为何用$test可以得到正确结果而$name_addslashes或$name却不行,初步判断是&符号问题,但是不知该如何修改,求助


回复讨论(解决方案)

猜测$name_addslashes中的& 变成& 实体了,你可以查看源码看看。

虽说是眼见为实
但看到的也不一定就是真相
var_dump( $name_addslashes == $test );
一切都暴露无遗

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template