П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3439 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 5995 раз(а).

Учебник HTML.
Просмотров 3221 раз(а).

Руководство по PHP5.
Просмотров 5442 раз(а).

Хостинг через призму DNS.
Просмотров 4050 раз(а).

Подборка текстов стандартных документов.
Просмотров 55723 раз(а).

Учебник PHP - Самоучитель
Просмотров 3021 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 4820 раз(а).

Внешние атаки...
Просмотров 3759 раз(а).

Учебник PHP.
Просмотров 2782 раз(а).

SSI в примерах.
Просмотров 37396 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

pg_convert

(PHP 4 >= 4.3.0, PHP 5)

pg_convert --  Convert associative array values into suitable for SQL statement

Описание

array pg_convert ( resource connection, string table_name, array assoc_array [, int options] )

pg_convert() checks and converts the values in assoc_array into suitable values for use in a SQL statement. Precondition for pg_convert() is the existence of a table table_name which has at least as many columns as assoc_array has elements. The fieldnames in table_name must match the indices in assoc_array and the corresponding datatypes must be compatible. Returns an array with the converted values on success, FALSE otherwise.

Замечание: 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.

Внимание

Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях 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.

Примеры

Пример 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);
?>

Смотрите также

pg_meta_data()


Пред. Начало След.
pg_connection_status Уровень выше pg_copy_from


Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru