pg_convert

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

pg_convert ������������ֵת��Ϊ�ʺ� SQL ���ĸ�ʽ��

˵��

pg_convert ( resource $connection , string $table_name , array $assoc_array [, int $options = 0 ] ) : array

pg_convert() ��� assoc_array �е�ֵ������ת��ΪΪ������ SQL ����ֵ��pg_convert() ��ǰ�����������еı� table_name �о��е��������� assoc_array �еĵ�Ԫ��ô�ࡣtable_name �е��ֶ����Լ��ֶ�ֵ����� assoc_array �еļ�����ֵƥ�䡣����ɹ��򷵻�һ������ת�����ֵ�����飬���򷵻� FALSE��

Note:

If there are boolean fields in table_name don't use the constant TRUE in assoc_array. It will be converted to the string 'TRUE' which is no valid entry for boolean fields in PostgreSQL. Use one of t, true, 1, y, yes instead.

Warning

�˺�����ʵ�����ġ��˺����ı��󣬰������Ƽ�������ĵ���������δ���� PHP �����汾��δ֪ͨ�ͱ��޸ġ�ʹ�ñ����������Ե� ��

����

connection

PostgreSQL database connection resource.

table_name

Name of the table against which to convert types.

assoc_array

Data to be converted.

options

Any number of PGSQL_CONV_IGNORE_DEFAULT, PGSQL_CONV_FORCE_NULL or PGSQL_CONV_IGNORE_NOT_NULL, combined.

����ֵ

An array of converted values, or FALSE on error.

����

Example #1 pg_convert() example

<?php 
  $dbconn 
pg_connect('dbname=foo');
  
  
$tmp = array(
      
'author' => 'Joe Thackery',
      
'year' => 2005,
      
'title' => 'My Life, by Joe Thackery'
  
);
  
  
$vals pg_convert($dbconn'authors'$tmp);
?>

�μ�