Jump to content

[SOLVED] SELECT ALL Causing a Access Violation


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.