PHP 7.2.0 Release Candidate 4 Released


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

pg_delete Deletes records


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

pg_delete() deletes records from a table specified by the keys and values in assoc_array. If options is specified, pg_convert() is applied to assoc_array with the specified options.



PostgreSQL database connection resource.


Name of the table from which to delete rows.


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.


Any number of PGSQL_CONV_FORCE_NULL, PGSQL_DML_NO_CONV, PGSQL_DML_ESCAPE, PGSQL_DML_EXEC, PGSQL_DML_ASYNC or PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the options then query string is returned. When PGSQL_DML_NO_CONV or PGSQL_DML_ESCAPE is set, it does not call pg_convert() internally.

Return Values

Returns TRUE on success or FALSE on failure. Returns string if PGSQL_DML_STRING is passed via options.


Example #1 pg_delete() example

// This is safe, since $_POST is converted automatically
$res pg_delete($db'post_log'$_POST);
  if (
$res) {
"POST data is deleted: $res\n";
  } else {
"User must have sent wrong inputs\n";


y"> e_na

ChaSee Also3>

pgl="stys-comseeAlsod convert()alues in <>

ction id="layu&nbnsRp;manit Cr on=p://"> add at caepantabl>> if

Char Subtrol ibu ExtNsiiv class="nexvsdii ivref="funnual/chavsRp;pervsup> dii ivref="funnual/chavsRp;pervs dii i2 Anonymouspaem>trong>

a hress="fungenan&nbr"ef="fun#41939"> &a"> ;> a h id=ss="titd" typee="PHP2004-04-27 03:47strong>pg_13 yeaone gotrong>

dv class="phpcode"> Ontrihould takhec fiew  &nb o&nb "Ns
Rp;manit Cr on=p://"> add at caepantabl>> -[if out-content"> < -conu-toglis ' Wypee="PHPcon​can&eln​ry" pl>con​can&eln​ry" p> con​cli-con​eding Su> <> aee="PHPcon​ame.phspcon​> Repcon​ate">R> eee="PHPcon​_cop​cepyepcon​_cop​cepy> eee="PHPcon​_scapen​byteaepcon​_scapen​bytea> eee="PHPcon​_scapen​idicatfiioepcon​_scapen​idicatfiio> strcon​_scapen​ing">s> arrcon​fetchn​ay">a> p" claee="PHPcon​fetchn​ults">rrcon​fetchn​ults">> aee="PHPcon​fds tn​e.phspcon​fds tn​> aee="PHPcon​fds tn​sizhspcon​fds tn​sizh> aee="PHPcon​fds tn​le"> con​fds tn​le"> > aee="PHPcon​fds tn​lypen​oid con​fds tn​lypen​oid> aee="PHPcon​fds tn​lype con​fds tn​lype> aee="PHPcon​flush con​flush> p" claee="PHPcon​freen​ults">rrcon​freen​ults">> aee="PHPcon​-inn​pid con​-inn​pid> p" claee="PHPcon​-inn​ults">rrcon​-inn​ults">> aee="PHPcon​s="tn​eoticerrcon​s="tn​eotice> aee="PHPcon​s="tn​oid con​s="tn​oid> <> anntstuhp'>Wypee="PHPcon​ameter">ap​ststuhspcon​ameter">ap​ststuhod strcon​p">s> -p?bureee="PHPcon​trea">-spcon​trea">-> Wypee="PHPcon​ry" pn​ametehspcon​ry" pn​ameteh> Wypee="PHPcon​ry" pspcon​ry" p> -ors.pnfds tp'>Wypee="PHPcon​ults">n​​fds tspcon​ults">n​​fds t> -ors.pp'>Wypee="PHPcon​ults">n​_rs.pspcon​ults">n​_rs.p> -seekp'>Wypee="PHPcon​ults">n​seektrcon​ults">n​seek> -ststuhp'>Wypee="PHPcon​ults">n​ststuhspcon​ults">n​ststuh> spcon​ect> > -p?bureee="PHPcon​s_cop​trea">-spcon​s_cop​trea">-> Wypee="PHPcon​s_cop​ry" pn​ametehspcon​s_cop​ry" pn​ameteh> Wypee="PHPcon​s_cop​ry" pspcon​s_cop​ry" p> con​sinn​cli-con​eding Su> n​​verbositpl>con​sinn​​verbositp> con​sockes> aee="PHPcon​tracel>con​trace> con​ttp> eee="PHPcon​un-scapen​byteaepcon​un-scapen​bytea> aee="PHPcon​untraceepcon​untrace> MyP 7)t/ma> h/ h/ Privach policy> h/
/div'/iptionspanption e stext">W?t=1421837618p;manf=/js/">/iptionspanption e stext">W?t=1421837618p;manf=/js/">/iptionspanption e stext">W?t=1421837618p;manf=/js/"> .min.j
    /iptionspanption e stext">W?t=1421837618p;manf=/js/">/iptionspanption e stext">W?t=1421837618p;manf=/js/search.j
      /iptionspanption e stext">W?t=1500560403p;manf=/js/menton.j
        /iptionsp hre"exatoTop"ef="funjavaiption:;span cla"exatoTopHovnbstran>>

Version Description
5.6.0 No l800er eybe;PGSQL_DML_ESCAPE is stants.p TRUE on/rong>FALSE on whorong>FALL, tabas e striort>> No Dir onc datinjion resassle_name, whoIndir onc da No injion res>