手机版
热门标签
站点地图
我要投稿
广告合作
联系我们
搜 索
广告位招租
广告位招租
切换导航
首页
人工智能
编程教程
编程导航
编程百科
编程问答
编程博文
编程实例
硬件设备
网络运营
软件教程
移动数码
办公软件
操作系统
网络运维
技术频道
▸ 编程语言
▸ 前端开发
▸ 移动开发
▸ 开发工具
▸ 程序设计
▸ 行业应用
▸ CMS系统
▸ 服务器
▸ 数据库
公众号推荐
微信公众号搜
"智元新知"
关注
微信扫一扫可直接关注哦!
prepared-statement
prepared-statement专题提供prepared-statement的最新资讯内容,帮你更好的了解prepared-statement。
使用PHP PDO预处理语句和MySQL选择字段为空的行
我一直在转换一个应用程序,使用PDO准备语句而不是 mysqli,我遇到了一个奇怪的问题.我在数据库中有一些记录,预计字段将为null.不是’null'(字符串),或”(空字符串),但是NULL.我动态地构建我的查询,所以在过去当我在对象中遇到一个null变量时,我会像这样构建查询: WHERE fieldName is null; 当字段为空时,将获得预期的结果. 现在使用PDO,我的查询没有返
作者:佚名 时间:2020-07-23
php – 为什么不能将MYSQL函数传递到准备好的PDO语句中?
在我看来,下面的脚本应该有效: $stmt = $db->prepare("UPDATE table SET status = ?, date_modified = ?"); $stmt->execute(array(1, 'NOW()')); 但是当将NOW()传递到准备好的语句中时,没有任何反应.替换NOW()与实际的日期(即2010-11-23)工作正常. 我无法在线找到解释.有任何想法吗?
作者:佚名 时间:2020-08-06
php – PDO在Codeigniter – 保护vs SQL注入
真正的 PHP安全专家,是PDO的方式,或者我可以使用Codeigniter的Active Record类吗? 我已经读过http://codeigniter.com/forums/viewthread/179618/,并没有100%的说服力. 我通常倾向于诸如Chris Shiflett和OWASP等专家的安全提示. http://shiflett.org/blog/2006/jul/the-o
作者:佚名 时间:2020-08-05
php – PDO位置和命名参数作为同一准备查询的一部分?
我正在用PDO学习绳索. 这是我的sql(可以出现在WHERE中的参数的数量是可变的). SELECT ID, title FROM table WHERE something = ? ORDER BY :sort :dir LIMIT :start, :results 这
作者:佚名 时间:2020-08-05
php – PDO准备语句 – 用于参数名称中的冒号是什么?
在使用PDO时,我已经看到许多使用冒号(:)在命名参数前面的文章,还有一些不使用冒号的文件.我只是尽快不使用冒号,只因为它是一个更少的按键,稍微更容易阅读. 对我来说似乎工作正常,但是如果在使用冒号时遇到一些重要的事情,我很好奇, 例如,这个工作很好: function insertRecord ($conn, $column1, $comumn2) { try { $in
作者:佚名 时间:2020-08-05
准备声明对于正常查询是浪费的? (PHP)
现在,“准备声明”似乎是任何人建议向数据库发送查询的唯一方法.我甚至看到建议使用准备好的语句存储过程.但是,对于额外的查询准备语句要求,以及它们最短的时间,我被说服只对一行INSERT / UPDATE查询有用. 我希望有人可以纠正我的这个,但它似乎是一个重复的整个“桌子是邪恶的”CSS的东西.如果用于布局而不是表格数据,表格只会是恶意的.使用DIV的表格数据是对WC3的风格违反. 像智慧一样,纯
作者:佚名 时间:2020-07-08
php – PDO是否总是默认使用模拟的准备语句?
PDO具有选项 PDO::ATTR_EMULATE_PREPARES,该控件只有在DB不支持或始终处于准备状态的情况下才能对其进行仿真.然而,它并没有提到它是否总是默认模拟它们. 通常人们会认为只有在必要的时候才使用仿真,但由于它是PHP,所以只能因为它是理智的 取决于数据库驱动程序.默认情况下,它们是默认情况下为7.0000(尽管您可以手动关闭该选项);在Postgres中,正确的默认设置是 d
作者:佚名 时间:2020-07-08
php – 一个准备好的语句,’WHERE .. IN(..)’查询和排序 – 与MySQL
想像一下我们有一个查询: SELECT * FROM somewhere WHERE `id` IN(1,5,18,25) ORDER BY `name`; 和要获取的ID数组:$ids = array(1,5,18,25) 准备好的语句是准备一个语句是adviced,并多次调用: $stmt = $mysqli->prepare('SELECT * FROM somewhere WHERE `i
作者:佚名 时间:2020-06-25
PHP5 sqli bind_param问题与绑定布尔值
我在 PHP5中使用mysqli_stmt :: bind_param绑定布尔值时遇到问题. SQL查询如下:插入nvp_notes(subject,messageid,receivedate,read)值(?,?,?,?) ‘read’是一个tinyint,0或1,因为我有使用mysqli的位问题.所以我在bind_param中列出的类型是: $stmt->bind_param('sdsd',
作者:佚名 时间:2020-05-15
php – 我还需要使用准备好的声明
参见英文答案 > Do I have to guard against SQL injection if I used a dropdown? 11个 使用PHP和MySQLi我有一个简单的表单,有4个HTML 5下拉选择列表输入.现在想知道我还需要使用Prepared Statement来保护我的数据库吗?我还有SQL注入问题
作者:佚名 时间:2020-05-02
php – mysqli_real_escape_string和准备语句?
应该是一个简单的问题: 如果我正在使用mysqli准备的语句,还需要使用mysqli_real_escape_string()吗? 这是必要的还是一个好主意? 谢谢,尼科 否.如果您使用准备好的语句,则为您完成转义.
作者:佚名 时间:2020-05-01
java:在H2中的executeBatch()之后检索键
我试图从executeBatch()事务中检索生成的键,但我只获取要添加的最后一个键. 这是我的代码: PreparedStatement ps_insert = conn.prepareStatement(insertQuery, PreparedStatement.RETURN_GENERATED_KEYS); for (int i = 0 ; i < ad
作者:佚名 时间:2020-02-01
如何在预处理语句java中插入Big Integer
我想使用预处理语句插入一个大整数值,我有一个名为xid的字符串变量(41527820021925053) preparedStatement = conn.prepareStatement(sql); preparedStatement.setObject(1,XOBJ); preparedStatement.setObject(2,YOBJ); preparedState
作者:佚名 时间:2020-04-22
java – ResultSet的Oracle JDBC性能
到目前为止,我一直在使用这样的查询我的数据库工作得非常好: PreparedStatement prepStmt = dbCon.prepareStatement(mySql); ResultSet rs = prepStmt.executeQuery(); 但后来我需要使用rs.first();为了能够多次迭代我的rs.所以我现在用 PreparedStatement prepStmt = db
作者:佚名 时间:2020-03-28
java – PreparedStatement:如何使用JDBC将数据插入到多个表中
有人能告诉我是否第一个stmt.close();以下JDBC代码中是否需要针对两个不同的表执行两个不同的SQL查询? public class MyService { private Connection connection = null; public void save(Book book) { try { Class.forName
作者:佚名 时间:2020-02-23
java – getGeneratedKeys()在PreparedStatement.executeBatch()之后
我想使用PreparedStatement插入几行: ps = con.prepareStatement(query,PreparedStatement.RETURN_GENERATED_KEYS); for(Element e:listOfElements){ ps.setString(1,this.col_val_1); ps.setString(2,this.col_val
作者:佚名 时间:2020-02-19
坚持PreparedStatements是否昂贵? (Java和JDBC)
我正在试图弄清楚在创建数据库连接时是否有效缓存我的所有语句,或者我是否应该创建最常用的语句,并在需要时创建其他语句. 在所有客户端线程中创建所有语句似乎很愚蠢.任何反馈将不胜感激. 一个像样的数据库将已经缓存它们.在您实际需要执行查询时,只需触发Connection#prepareStatement().您实际上也没有其他选择,因为应该在尽可能短的范围内获取和关闭连接,语句和结果集,即在与执行查询
作者:佚名 时间:2020-02-19
java – 预编译JDBC PreparedStatement是什么?
一个声明“预编译”是什么,因为我已经看到了 如果我编写一个编译没有报告的SQL语法的准备语句 任何问题! 所以如果预编译一个准备好的语句不会检查语法的有效性,它究竟做了什么呢? 创建PreparedStatements可能涉及或可能不涉及SQL语法验证或甚至完全依赖于所使用的JDBC驱动程序的DB服务器往返.一些司机会做一个往返或验证,其他人不会. 所以在一些JDBC驱动程序上,PreparedS
作者:佚名 时间:2019-06-13
java – 两个不同的准备语句在一个单一的批处理
我想在一个批次中发送两个不同的准备好的语句. 目前我正在做两件事,你可以在注释的行中看到它的作用,但这不是这里的主要目的.任何人都可以告诉我要做些什么来取代这些意见吗? import java.lang.ClassNotFoundException; import java.math.BigDecimal; import java.sql.Connection; import java.sql.P
作者:佚名 时间:2019-06-04
什么时候应该关闭Java PreparedStatement?
在 “Using Prepared Statements”教程中,它指出它们应该始终关闭.假设我有一个功能 getPrice() { } 我希望每秒被叫多次.这个方法应该用每一个方法调用来打开和关闭PreparedStatement吗?这似乎是很多开销. 首先,PreparedStatement从不打开.这只是一个准备好的声明被执行.该语句被发送到执行由PreparedStatement编译的SQ
作者:佚名 时间:2019-06-03
上一页
9
10
11
12
13
14
15
16
17
下一页
小编推荐
苹果市值2025年有望达4万亿美元
• 联想拯救者新一代Y700平板通过IMDA认证
• 最新AI生图模型Flux1.1刷屏!添加单反相
• 联发科天玑 9400 频率敲定,3.626GHz 最
• 苹果新品发布会来了!5款产品面临停产
• 佳能R5C Mark II配置曝光:双系统设计,
• AI应用的东风,奥特曼不想错过
• 为新品让路!苹果定制版Mac发货延期
热门标签
更多
python
JavaScript
java
HTML
PHP
reactjs
C#
Android
CSS
Node.js
sql
r
python-3.x
MysqL
jQuery
c++
pandas
Flutter
angular
IOS
django
linux
swift
typescript
路由器
JSON
路由器设置
无线路由器
h3c
华三
华三路由器设置
华三路由器
电脑软件教程
arrays
docker
软件图文教程
C
vue.js
laravel
spring-boot