pg_delete

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

pg_delete 删锟斤拷锟斤拷录

说锟斤拷

pg_delete ( resource $connection , string $table_name , array $assoc_array [, int $options = PGSQL_DML_EXEC ] ) : mixed

pg_delete() 删锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷录锟斤拷锟斤拷锟斤拷锟斤拷 assoc_array 锟斤拷锟斤拷 field=>value 锟斤拷式锟斤拷锟斤拷锟斤拷锟斤拷锟街革拷锟斤拷锟� option锟斤拷锟斤拷 pg_convert() 锟斤拷锟秸革拷选锟斤拷锟斤拷锟斤拷锟斤拷 assoc_array 之锟较★拷

锟斤拷锟斤拷

connection

PostgreSQL database connection resource.

table_name

Name of the table from which to delete rows.

assoc_array

An array whose keys are field names in the table table_name, and whose values are the values of those fields that are to be deleted.

options

Any number of PGSQL_CONV_FORCE_NULL, PGSQL_DML_NO_CONV, PGSQL_DML_EXEC or PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the options then query string is returned.

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷 Returns string if PGSQL_DML_STRING is passed via options.

锟斤拷锟斤拷

Example #1 pg_delete() 锟斤拷锟斤拷

<?php 
  $db 
pg_connect('dbname=foo');
  
// This is safe, since $_POST is converted automatically
  
$res pg_delete($db'post_log'$_POST);
  if (
$res) {
      echo 
"POST data is deleted: $res\n";
  } else {
      echo 
"User must have sent wrong inputs\n";
  }
?>

Warning

锟剿猴拷锟斤拷锟斤拷实锟斤拷锟斤拷锟侥★拷锟剿猴拷锟斤拷锟侥憋拷锟襟,帮拷锟斤拷锟斤拷锟狡硷拷锟斤拷锟斤拷锟斤拷牡锟斤拷锟斤拷锟斤拷锟斤拷锟轿达拷锟斤拷锟� PHP 锟斤拷锟斤拷锟芥本锟斤拷未通知锟酵憋拷锟睫改★拷使锟矫憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆碉拷 锟斤拷

锟轿硷拷

  • pg_convert() - 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷值转锟斤拷为锟绞猴拷 SQL 锟斤拷锟侥革拷式锟斤拷