home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / PHP / largeobj.php3.txt < prev    next >
Encoding:
Text File  |  2002-05-06  |  469 b   |  17 lines

  1. Large objects 
  2.  
  3. This is just a tiny example showing how to create a PostgreSQL large object from PHP3. 
  4.  
  5. <? 
  6.   $database = pg_Connect ( "",  "",  "",  "",  "jacarta"); 
  7.   pg_exec ($database,  "BEGIN"); 
  8.   $oid = pg_locreate ($database); 
  9.   echo ( "$oid\n"); 
  10.   $handle = pg_loopen ($database, $oid,  "w"); 
  11.   echo ( "$handle\n"); 
  12.   pg_lowrite ($handle,  "foo"); 
  13.   pg_loclose ($handle); 
  14.   pg_exec ($database,  "COMMIT"); 
  15.   pg_close ($database); 
  16. ?> 
  17.