note 114507 added to function.pg-result-status
| From: | Anonymous | Date: | Sat, 01 Mar 2014 18:44:29 +0000 |
| Subject: | note 114507 added to function.pg-result-status | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198753@lists.php.net to get a copy of this message | ||
This function is useful it may not return a full non fatal error but you want to see if the query
completes anyway.
example
<?PHP
//connect to pg database
// create PGSQL
$PGSTAT = pg_result_status($PGSQL);//defaults to long
//And run it through a check for example
if(($PGSTAT == 1) || ($PGSTAT == 2)){
// for query results;
}else if(($PGSTAT == 3) || ($PGSTAT == 4)){
// for copy results;
}
if(($PGSTAT != 0) && ($PGSTAT != 5) && ($PGSTAT != 6) && ($PGSTAT != 7)){
// your code;
}else{
// $ERRORS codes;
}
// This is worked the best for me so far I tried using
// The command tag and I seem to still get an numeric result
//example
//$PGSTAT = pg_result_status($PGSQL, PGSQL_COMMAND_OK);
// got something like tuples ok so I recommend just use default long
?>
or use what ever condition check you feel fit
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.pg-result-status.php
Edit -- https://master.php.net/note/edit/114507
Del: integrated -- https://master.php.net/note/delete/114507/integrated
Del: useless -- https://master.php.net/note/delete/114507/useless
Del: bad code -- https://master.php.net/note/delete/114507/bad+code
Del: spam -- https://master.php.net/note/delete/114507/spam
Del: non-english -- https://master.php.net/note/delete/114507/non-english
Del: in docs -- https://master.php.net/note/delete/114507/in+docs
Del: other reasons-- https://master.php.net/note/delete/114507
Reject -- https://master.php.net/note/reject/114507
Search -- https://master.php.net/manage/user-notes.php