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);

最新文章

  1. 七牛整合php上传从微信下载接口下载下来的文件
  2. stm32f系列单片机startup_stm32fxxx.s文件说明(转)
  3. 【转】asp.net Cookie值中文乱码问题解决方法
  4. mysql 远程访问
  5. 【MariaDB】MariaDB的复制
  6. Windows如何安装自定义服务
  7. mvn打包
  8. Function.prototype.call.apply结合用法
  9. C# 3循环 for语句应用
  10. HDU 2227 Find the nondecreasing subsequences(DP)
  11. 使用线程执行堆栈StackTraceElement设计Android日志模块
  12. Inno Setup入门(四)——为程序创建桌面快捷方式
  13. javaweb-3-在Eclipse中引入Tomcat
  14. GitHub 系列之「向GitHub 提交代码」
  15. No module named "Crypto",如何安装Python三方模块Crypto
  16. 解决 Cannot get IBus daemon address 问题
  17. c# excel xls保存
  18. 一次enq: TX - index contention等待事件处理
  19. D3.js 制作中国地图
  20. 整合Spring+Struts2+Mybatis加spring单元测试等

热门文章

  1. vim之quickfix
  2. Banner设计的视觉导向原则分析
  3. 前后台交互(打开前端页面,不传递任何数据,发送ajax请求)
  4. 5. Import the project download from Git
  5. source Insight工程的简单使用
  6. 2018.09.08 AtCoder Beginner Contest 109简要题解
  7. hdu-1070(水题)
  8. Criteria查询
  9. HDU 3247 Resource Archiver (AC自动机+BFS+状压DP)
  10. CentOS中的一些小技巧和特殊知识