sgsheg

<?php
/**
* mysql_real_escape_string -转义sql语句中使用的字符串中的特殊字符,并考虑到连接的当前字符集,
* mysql_real_escape_string()不转义%和_
*
* mysql_real_escape_string(string $unescaped_string[,resource $link_identiffer])
* 本函数将unescaped_string中的特殊字符串转义,并计及连接的当前字符集,因此可以安全用于mysql_query()
*/
$item="zak\'s and Derick\'s Laptop";
$escape_item=mysql_real_escape_string($item);

print_r($escape_item);

分类:

技术点:

相关文章:

  • 2021-12-07
  • 2021-11-28
  • 2021-04-15
  • 2021-11-04
  • 2021-06-29
  • 2021-11-28
  • 2021-06-16
  • 2021-05-03
猜你喜欢
  • 2021-09-25
  • 2021-08-16
  • 2021-11-15
  • 2022-02-28
相关资源
相似解决方案