|
Home
iRate! IceMelon IM Tutorials Headlines CoolSites PHP Functions |
|
Most Referenced Functions » google_pagerank() » preg_replace() » imagecreatefrompng() » site_pageranks() » imagepng() » imagedestroy() » imagestring() » imagecolorallocate() » htmlentities() » preg_match() » fopen() » header() » getimagesize() » preg_match_all() » session_start() » htmlspecialchars() » ob_start() » ob_flush() » strstr() » flush() » strpos() » setcookie() » str_replace() » array2vars() » nl2br() » preg_split() » ereg() » ereg_replace() » urlencode() » readgzfile() Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m. |
PHP Functions
Function: pg_copy_from (PHP 4 >= 4.2.0, PHP 5) pg_copy_from -- Insert records into a table from an arrayDescriptionbool pg_copy_from ( resource connection, string table_name, array rows [, string delimiter [, string null_as]] )pg_copy_from() inserts records into a table from rows . It issues a COPY FROM SQL command internally to insert records. Parameters
connection PostgreSQL database connection resource. table_nameName of the table into which to copy the rows . rowsAn array of data to be copied into table_name . Each value in rows becomes a row in table_name . Each value in rows should be a delimited string of the values to insert into each field. Values should be linefeed terminated. delimiterThe token that separates values for each field in each element of rows . Default is TAB . null_asHow SQL NULL values are represented in the rows . Default is \N ("\\N"). Return ValuesReturns TRUE on success or FALSE on failure. Examples
Example 1. pg_copy_from() example
<?php
$db = pg_connect("dbname=publisher") or die("Could not connect");
$rows = pg_copy_to($db, $table_name);
pg_query($db, "DELETE FROM $table_name");
pg_copy_from($db, $table_name, $rows);
?>
Related Function(s) |