gpt4 book ai didi

PHP MySql 查询丢失

转载 作者:行者123 更新时间:2023-11-30 00:55:22 25 4
gpt4 key购买 nike

我有 MySQL 数据库,我想从 php 对其运行查询。

查询是由 php 生成的:

$sql = "INSERT INTO $tablename (title, link, pubdate, insertdate)
VALUES ('$title', '$link', '$pubDate', '$date')";

这会产生以下查询

INSERT INTO tbluknova (title, link, pubdate, insertdate) 
VALUES (' Through The Keyhole S01E07 Christmas Special.avi {{Gameshow}, {New}} ',
'http://www.website.ph/wsgi/feed/b1d2793376065c7cec861d156771e162/8854',
'Mon, 16 Dec 2013 02:56:35 GMT',
'2013-12-16 07:38:20'
)

当 PHP 运行此查询时,标题字段中没有条目。

如果我手动运行此查询,查询工作正常,并且所有字段都有正确的条目。

即使标题字段中没有显示任何条目,如果我运行搜索搜索该条目的标题字段 MySQL 找到了它!!!!!!

select 
*
from tbluknova
where title LIKE '%Through The Keyhole S01E07 Christmas Special.avi {{Gameshow}, {New}}%'

这让我发疯。

感谢您的阅读和帮助

最佳答案

mysqli_real_escape_string 是您所需要的:

看一下: http://www.php.net/manual/en/mysqli.real-escape-string.php

关于PHP MySql 查询丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20606000/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com