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
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
Share on other sites

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.