PDOStatement execute memory issue?
| From: | Carlton Whitehead | Date: | Wed, 26 Sep 2007 18:21:19 +0000 |
| Subject: | PDOStatement execute memory issue? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-262483@lists.php.net to get a copy of this message | ||
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