coxeh Posted March 25, 2009 Share Posted March 25, 2009 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/151113-solved-select-all-causing-a-access-violation/ Share on other sites More sharing options...
Mchl Posted March 25, 2009 Share Posted March 25, 2009 What happens if, you select all columns, by explicitly listing their names? Quote Link to comment https://forums.phpfreaks.com/topic/151113-solved-select-all-causing-a-access-violation/#findComment-793909 Share on other sites More sharing options...
bluejay002 Posted March 26, 2009 Share Posted March 26, 2009 I am not sure though maybe try asking the administrator if it was disallowed... yet am still wondering. If nothing good happens, better try Mchl's suggestion. Quote Link to comment https://forums.phpfreaks.com/topic/151113-solved-select-all-causing-a-access-violation/#findComment-794184 Share on other sites More sharing options...
corbin Posted March 26, 2009 Share Posted March 26, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/151113-solved-select-all-causing-a-access-violation/#findComment-794201 Share on other sites More sharing options...
coxeh Posted March 26, 2009 Author Share Posted March 26, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/151113-solved-select-all-causing-a-access-violation/#findComment-794373 Share on other sites More sharing options...
corbin Posted March 26, 2009 Share Posted March 26, 2009 ;p Quote Link to comment https://forums.phpfreaks.com/topic/151113-solved-select-all-causing-a-access-violation/#findComment-794484 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.