pg_update

(PHP 4 >= 4.3.0, PHP 5)

pg_update --  Update table

Popis

mixed pg_update ( resource connection, string table_name, array data, array condition [, int options] )

pg_update() updates records that matches condition with data. If options is specified, pg_convert() is applied to data with specified options.

Varovanie

T�to funkcia je EXPERIMENT�LNA. Spr�vanie tejto funkcie, n�zov tejto funkcie a hoci�o in� zdokumentovan� o tejto funkcii sa m�e zmeni� bez pov�imnutia v bud�com vydan� PHP. Pou��vajte t�to funkcii na svoje vlastn� riziko.

Príklady

Príklad 1. pg_update() example

<?php
  $db
= pg_connect('dbname=foo');
  
$data = array('field1'=>'AA', 'field2'=>'BB');
  
  
// This is safe, since $_POST is converted automatically
  
$res = pg_update($db, 'post_log', $_POST, $data);
  if (
$res) {
      echo
"Data is updated: $res\n";
  } else {
      echo
"User must have sent wrong inputs\n";
  }
?>

Tiež pozri

pg_convert()