- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个特别棘手的问题需要解决,但还没有解决问题。我已经在 drupal 问题队列中发布了这个,但我可能只是被忽略了。这是 Drupal Issue 1061458 的链接.
这是在我的 centos 机器上使用 apache mysql 和 php 在 Drupal 6 中完成的。
每次有人到达页面时,我都尝试插入一个内容,所以我放了一个愚蠢的空白页面并创建了内容,然后我将我的动态 block 放在那里以从模块运行我的代码。我使 block 调用一个函数,该函数获取用户的 ip 地址并将其与标志一起存储在数据库中,直到该人注册为止。
这是生成的错误
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group) VALUES ('','')' at line 1 query: INSERT INTO group_landing_connection (ipaddress,group) VALUES ('','') in /var/www/html/sites/all/modules/MODULE/MODULE.module on line 1130.
有了这些精确的转义引号,这里就是 block 函数中的违规代码
$sql = "INSERT INTO {group_landing_connection} (ipaddress,group) VALUES ('%s','%d')";
db_query($sql,$ip,$group);
其中Ip和group在上面设置。这是模块安装文件中的数据库格式
$schema['group_landing_connection'] = array(
'fields' => array(
'dbid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ),
'ipaddress' => array('type' => 'varchar', 'length' => '30', 'not null' => TRUE, ),
'group' => array('type' => 'varchar', 'length' => '10', 'not null' => TRUE, ),
),
'primary key' => array('dbid'),
);
我尝试了很多方法,从将 dbid 设置为 null 到设置自动增量值。运行 cron 并刷新缓存。 block 缓存已关闭。我什至尝试使用 %b 进行二进制数据输入,但没有。我尝试删除替换值和硬编码数字而不是运气。我尝试在一个有效的数据库调用之后立即进行此调用,但它仍然失败,所以我认为这不是 block 的错误。我什至尝试使用这段代码进行更安全的 db_write_record 调用
$data = array(
'ipaddress' => '3',
'group' => '3',
);
drupal_write_record('np_group_landing_connection', $data);
但是没有人有任何想法?
最佳答案
关于php - 将数据插入表 : Escaped Quotes? 时出现 Drupal DB 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6126040/
一个简单的GNU m4问题,但是我找不到正确的答案。我想在代码部分的开始/结束处打印一个markdown header : ``` echo Hello ``` 如何创建包含3个反引号的GNU M4宏
我有一个 shell 变量(我们将调用 x),其中包含一个带有 shell 元字符的字符串。例如,我可能有 abc "def's" ghi 设置为 x='abc "def'\''s" ghi'
我有一个 shell 变量(我们将调用 x),其中包含一个带有 shell 元字符的字符串。例如,我可能有 abc "def's" ghi 设置为 x='abc "def'\''s" ghi'
执行以下行时: df = df[df['Directory'].str.contains("C:\Windows\System32\Tasks")] 我收到以下错误: File "/Users/pat
我正在使用 python-social-auth 从我的 Django 应用程序登录社交网络。在我的本地机器上一切正常,但是当我部署到服务器时出现以下错误: oauthlib.oauth1.rfc58
URI.escape 和 CGI.escape 有什么区别,我应该使用哪一个? 最佳答案 斧头和剑有什么区别,我应该使用哪一种?好吧,这取决于您需要做什么。 URI.escape 应该将字符串 (UR
我今天安装了 Zenwalk Linux。我发现 Escape 键没有绑定(bind)到任何东西(至少据我所知),而是 Escape 通常会做什么(关闭程序,打开 vim 命令行等)Shift-Esc
我遇到过一种情况,闭包可能在函数 f1 内部调用(闭包被传递到其中),或者可能会传递给其他函数 f2 >。 所以现在我想知道应该如何定义这个闭包的转义行为。我的意思是我应该放 @escaping 还是
在 js/jQuery 中有没有办法拥有这两种按键组合? ESCape 键 和 SHIFT + ESCape 键 当我实现它时使用: document.onkeydown = function(e){
我正在尝试将字符串中的任何换行符或转义换行符规范化为转义的 unix 换行符。我不明白为什么这不起作用: Pattern EOL = Pattern.compile("(\\\\r)?\\\\n|\r
swift 4.2,Xcode 10.1 在我正在处理的订单处理应用程序中,用户可以搜索已处理或提交的订单。发生这种情况时,它将检查是否有订单缓存,如果没有,它将使用异步 API 请求重新填充该缓存,
我的几个网页名称中包含以下字符&,例如“Shipping & Deliveries”等 我的架构标记注入(inject)了 GTM (JSON-LD),但在 SDTT 中我收到以下错误: Uncate
自版本 1.9.0 起,Twig为 escape 过滤器提供 html_attr 策略(参见 documentation )。 html 策略使用 htmlspecialchars PHP 函数(通过
我有一个像这样的 View Controller : class PublicationListViewController: UIViewController { var publicati
这是我的代码: class Main { init() { let x = Sub(s: foo) } func foo(completion: @escapi
我正在尝试将闭包用于一阶谓词演算,并且我打算定义以下函数: func ASSUM(p: @escaping Pred) -> (Pred) -> Pred { return { q in AN
我有关于 ezSQL_mysql 和 ezSQLcore 的问题,它可能是 PHP 版本不兼容,我分享下面的代码。我应该使用什么版本的 PHP 或者我应该做什么来定制 mysqli? (我的PHP版本
我有以下函数,其中有完成处理程序,但出现此错误: Closure use of non-escaping parameter may allow it to escape 这是我的代码: func m
我正在使用 Swift-VectorBoolean 库,它目前在 Swift 3.2 上,尚未针对 Swift 4.2 进行更新,但应该仍可在 Xcode 10 上运行。在 Xcode 9 上运行它,
我想用这个 ansible 命令在 nrpe.cfg 中插入一个 nrpe 命令 check_tomcat_threads.pl -H localhost -p 30011 -C '"http-bio
我是一名优秀的程序员,十分优秀!