Jump to content

pdo query fails...


orlox

Recommended Posts

Hi!

 

Im using a paid server wich fails anytime I do a query using PDO (the same sccript I test works on my personal server...).

 

My test query is this:

 

<?php

echo "hi!";

$connection = new PDO("mysql:host=localhost;dbname=test", "user", "pass");

$res=$connection->query("Show databases;");

echo "bye!";

 

On my apache server on my computer, this works correctly, and show both messages. However, on the server Im trying to use to put my webpage, the script fails, it outputs nothing, and firefox asks me to download the php file which has 0 kb...Commenting on the query line gives me both messages though...

 

I made a phpinfo() and the configure used to compile php has --disable-pdo in it. However, it also shows the pdo mysql driver version...Also the script doesnt fail on creating the PDO object, so pdo libraries are actually included...

 

Is it just the server thats messed up?? Or perhaps some strange php variable needs to be changed???

 

Plz help!

Link to comment
https://forums.phpfreaks.com/topic/157183-pdo-query-fails/
Share on other sites

PDO not set up in your php installation.. to be honest I never used PDO or know what it is, but assuming it comes with PHP, the webhosting company you're using probably disables this functionality for whatever reasons.. maybe contact tech support.

Link to comment
https://forums.phpfreaks.com/topic/157183-pdo-query-fails/#findComment-828273
Share on other sites

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.