成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? PHP:pg_escape_literal()的用法_PostgreSQL函數
全站頭部文字 我要出現在這里
PHP:pg_escape_literal()的用法_PostgreSQL函數 824 2023-12-12   

pg_escape_literal

(PHP 5 >= 5.4.4)

pg_escape_literal — Escape a literal for insertion into a text field

說明

string pg_escape_literal ([ resource $connection ], string $data )

pg_escape_literal() escapes a literal for querying the PostgreSQL database. It returns an escaped literal in the PostgreSQL format. pg_escape_literal() adds quotes before and after data. Users should not add quotes. Use of this function is recommended instead of pg_escape_string(). If the type of the column is bytea, pg_escape_bytea() must be used instead. For escaping identifiers (e.g. table, field names), pg_escape_identifier() must be used.

Note:

This function has internal escape code and can also be used with PostgreSQL 8.4 or less.

參數

connection

PostgreSQL database connection resource. When connection is not present, the default connection is used. The default connection is the last connection made by pg_connect() or pg_pconnect().

data

A string containing text to be escaped.

返回值

A string containing the escaped data.

范例

Example #1 pg_escape_literal() example

<?php 
  // Connect to the database
  $dbconn = pg_connect('dbname=foo');
  
  // Read in a text file (containing apostrophes and backslashes)
  $data = file_get_contents('letter.txt');
  
  // Escape the text data
  $escaped = pg_escape_literal($data);
  
  // Insert it into the database. Note that no quotes around {$escaped}
  pg_query("INSERT INTO correspondence (name, data) VALUES ('My letter', {$escaped})");
?>

參見

pg_escape_identifier() - Escape a identifier for insertion into a text field pg_escape_bytea() - 轉義 bytea 類型的二進制數據 pg_escape_string() - 轉義 text/char 類型的字符串


主站蜘蛛池模板: 高潮艺术| 就义诗诗配画| 吉林旅游必去十大景点| 龙八夷| 扭曲的欲望| 乐队的夏天 综艺| 正宗辅星水法九星断语| 少妇bbbbbbb| 名字简写设计| 凌靖| 慕思成| 案例分析100例| 孔大山| 比基尼诱惑| 北京卫视今晚节目表| 牵牛花的生长变化记录| 娇喘视频在线观看| 座头市电影完整免费观看| 神宫奈绪| 初三化学试卷| 菊花开| 吴添豪| 茅山道士在线观看| 电影疯狂之人| 楼下的女邻居| 疯狂72小时演员表| 妻子的秘密免费看全集| 深夜在线观看视频| 电影潘金莲| 山西少儿频道| 绿野仙踪电影| 创新点| 金奎丽| 花落花开电影| 2025年最旺财聚财壁纸| 张国立个人资料简介| 大学英语综合教程1答案| 微信图像男| 上海东方卫视节目表| 花飞满城春 电影| 只要有你还珠格格|

!!!站長長期在線接!!!

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103