Jump to content

[SOLVED] SELECT ALL Causing a Access Violation


coxeh

Recommended Posts

Hi,

 

im having an issue with i think one of my servers. i keep getting a access violation error when i select * using PDO. However if i select just one cell from the table the script works fine. It probally best explained with my example script

 

This causes an error message of PHP has encountered an Access Violation at 0203249A

<?php
require_once('--removed--');
$DB = new PDO(__PDODNS, __PDOUSERNAME, __PDOPASSWORD);
$DB->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,1); 
$sth = $DB->prepare('SELECT * FROM `site_pages` WHERE `link` = ?');
$sth->execute(array('index'));
$results = $sth->fetchAll();
print_r($results);
$DB=NULL;
?>

 

However this works fine

<?php
require_once('--removed--');
$DB = new PDO(__PDODNS, __PDOUSERNAME, __PDOPASSWORD);
$DB->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,1); 
$sth = $DB->prepare('SELECT `html` FROM `site_pages` WHERE `link` = ?');
$sth->execute(array('index'));
$results = $sth->fetchAll();
print_r($results);
$DB=NULL;
?>

 

My Server Details Are:

windows 2003

PHP Version 5.2.8

Mysql 5.1.32-community

 

Does anyone have any ideas why i can only select one cell ?

If I had to throw a guess out there, I would guess either a bug in the PDO extension or your PDO extension is corrupted.  Or MySQL lib versions are wrong or something.

 

good guess :)

 

I was using the extensions from 5.2.9 but had php 5.2.8 installed, when i updated php to the latest version it worked perfectly.

 

thanks for all your replies

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.