MySQL(动态执行SQL)
2024-08-20 10:58:43
day61
防sql注入
delimiter \\
CREATE PROCEDURE p4 (
in tpl varchar(255),
in arg int
)
BEGIN
set @xo = arg;
PREPARE xxx FROM 'select * from student where sid > ?'; #准备执行
EXECUTE xxx USING @xo;#会将?替换 @xo
DEALLOCATE prepare xxx; #xxx名字随便取 #开始执行
END\\
delimiter ;
using后必须是局部变量,"@"是:局部变量声明。
调用时:
call p7("select * from tb where id > ?",9);
最新文章
- 七牛整合php上传从微信下载接口下载下来的文件
- stm32f系列单片机startup_stm32fxxx.s文件说明(转)
- 【转】asp.net Cookie值中文乱码问题解决方法
- mysql 远程访问
- 【MariaDB】MariaDB的复制
- Windows如何安装自定义服务
- mvn打包
- Function.prototype.call.apply结合用法
- C# 3循环 for语句应用
- HDU 2227 Find the nondecreasing subsequences(DP)
- 使用线程执行堆栈StackTraceElement设计Android日志模块
- Inno Setup入门(四)——为程序创建桌面快捷方式
- javaweb-3-在Eclipse中引入Tomcat
- GitHub 系列之「向GitHub 提交代码」
- No module named ";Crypto";,如何安装Python三方模块Crypto
- 解决 Cannot get IBus daemon address 问题
- c# excel xls保存
- 一次enq: TX - index contention等待事件处理
- D3.js 制作中国地图
- 整合Spring+Struts2+Mybatis加spring单元测试等
热门文章
- vim之quickfix
- Banner设计的视觉导向原则分析
- 前后台交互(打开前端页面,不传递任何数据,发送ajax请求)
- 5. Import the project download from Git
- source Insight工程的简单使用
- 2018.09.08 AtCoder Beginner Contest 109简要题解
- hdu-1070(水题)
- Criteria查询
- HDU 3247 Resource Archiver (AC自动机+BFS+状压DP)
- CentOS中的一些小技巧和特殊知识