PDOStatement execute memory issue?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone, 

I'm working on a script that downloads archived fax images (TIFFs and PDFs) from a MS SQL Server using the PDO ODBC driver. I get the below error regardless of which fax I try to get from the database. Each fax is a different size, and both of the memory allocation numbers are always the same: 

Fatal error: Out of memory (allocated 262144) (tried to allocate 4294967295 bytes) in C:\Inetpub\wwwroot\FMarchive\library\faxInbound.php on line 81 

The above error happened when querying a fax with a size of 17723 bytes.  According to my phpinfo(); page, the memory_limit is 128MB.

My machine has the below specs:
Windows Server 2003 SP2
IIS 6
2GB RAM
Microsoft SQL Server 2005 SP2
PHP 5.2.4

Here is the excerpt from my code: 

	public function downloadFax($id, $attid, $attsize)
	{
		try
		{
				$stmt = 'SELECT filename, attdata FROM fm_faxin_att WHERE id = :id AND attid = :attid';
				$pstmt = $this->db->prepare($stmt);
				$pstmt->bindValue(':id', $id);
				$pstmt->bindValue(':attid', $attid);
				$pstmt->execute(); // this is the Line 81 referenced by the error message
				$pstmt->bindColumn('filename', $filename, PDO::PARAM_STR);
				$pstmt->bindColumn('attdata', $data, PDO::PARAM_LOB);
				$pstmt->fetch(PDO::FETCH_BOUND);
				
				return array('attdata' => $data, 'filename' => $filename);
		}
		catch (PDOException $e)
		{
				die($e->getMessage());
		}
	}

Any ideas?

Regards, 
Carlton Whitehead 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux