您好,欢迎访问一九零五行业门户网

php-ajax 从页面中获取元素传递给PHP 进行数据库查询的问题

ajaxphp数据库
ajax从界面中获取id为username的文本内容“张三”
$.ajax({ type:post, url:getallleads.php, data:account=+$(#username).text(), success:function(data){showalllead(data);} })
php中接收,并查询的语句如下:
$account=$_post[account]; echo $account; echo gettype($account); $result = $conn->query(select * from allsalesleads where 销售人员 like '%.$account.%');
结果能够echo出account 内容为‘张三’ 数据类型为string 但没有查询结果
然后我直接在在如下php中给account赋值 张三,可以查询出。account前后的数据类型都是string
$account=$_post[account]; echo $account; echo gettype($account); $account='张三';echo gettype($account); $result = $conn->query(select * from allsalesleads where 销售人员 like '%.$account.%');
然后我想难道前后两个account不一样吗?
然后
if ($account==张三) 来进行判断,结果还真不一样,这是咋回事啊?
有什么解决办法吗?非常感谢!
其它类似信息

推荐信息