1. $Model->where("id=%d and username='%s' and xx='%f'",array($id,$username,$xx))->select();
强制转换变量类型,防止sql注入。
%d - double,包含正负号的十进制数(负数、0、正数)
%s - string,字符串
%f - float,浮点数

相关文章:

  • 2021-12-26
  • 2021-09-22
  • 2021-12-04
  • 2021-04-02
  • 2021-09-28
  • 2022-02-22
  • 2021-10-04
  • 2021-06-16
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2021-05-15
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案