PDO object not found in php 5.2.5

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

PDO object not found in php 5.2.5

Post by highjo »

HI!
As every body i'm getting interreste by the OOP in php and found it great.But here are somes issues that i can't figure out.I'm on windows and ugraded to the last version of xampp with the version 5.2.5 of php.This my first try on the PDO class and i'm having Object not found in the browser with error 404.
here is my code:

Code: Select all

 
<?php
//the db_login.php is my config file containning $db_host, $db_user, $db_password and $db_database.
include_once('db_login.php');
$dsn = "mysql:host=$db_host;dbname=$db_database";
$group=4;//used by the query for my table users
try
    {
        $pdo= new PDO($dsn, $db_user, $db_password);
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        
        $sql='select * from users WHERE Id_group=:group';
        $stmt=$pdo->prepare($sql);
        $stmt->bindParam(':group', $group, PDO::PARAM_INT);
        $stmt->execute();
        while ($row= $stmt->fetch(PDO::FETCH_ASSOC))
        {
            print $row['name'] .'\t';
            print $row['surname'].'\t';
            print $row['ville'] .'\t';
        }
    }
    catch (PDOException $e)
    {
        echo "PDO exception caught \n";
        echo 'error' . $e->getMessage();
    }
?>
 
and this is my extension part of my php.ini file

Code: Select all

 
;extension=php_apd.dll
;extension=php_bcompiler.dll
;extension=php_bitset.dll
;extension=php_blenc.dll
;extension=php_bz2.dll
;extension=php_bz2_filter.dll
;extension=php_classkit.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_cvsclient.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_dio.dll
;extension=php_docblock.dll
;extension=php_domxml.dll
;extension=php_event.dll
;extension=php_fdf.dll
;extension=php_fileinfo.dll
;extension=php_filepro.dll
;extension=php_filter.dll
;extension=php_fribidi.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_gopher.dll
;extension=php_hash.dll
;extension=php_http.dll
;extension=php_hyperwave.dll
;extension=php_ibm_db2.dll
;extension=php_id3.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imagick.dll
extension=php_imap.dll
;extension=php_ingres.dll
;extension=php_interbase.dll
;extension=php_ixsfunc.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_lzf.dll
;extension=php_mailparse.dll
;extension=php_maxdb.dll
extension=php_mbstring.dll
extension=php_exif.dll
;extension=php_mcrypt.dll
;extension=php_mcrypt_filter.dll
;extension=php_memcache.dll
;extension=php_mhash.dll
extension=php_mime_magic.dll
extension=php_ming.dll
;extension=php_msql.dll
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_netools.dll
;extension=php_ntuser.dll
;extension=php_oci8.dll
;extension=php_oggvorbis.dll
extension=php_openssl.dll
;extension=php_parsekit.dll
extension=php_pdf.dll
extension=php_pdo.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_perl.dll
;extension=php_pgsql.dll
;extension=php_phpdoc.dll
;extension=php_pop3.dll
;extension=php_printer.dll
;extension=php_pspell.dll
;extension=php_radius.dll
;extension=php_runkit.dll
;extension=php_sdo.dll
;extension=php_sdo_das_xml.dll
;extension=php_shmop.dll
;extension=php_smtp.dll
;extension=php_snmp.dll
extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite.dll
;extension=php_ssh2.dll
;extension=php_stats.dll
;extension=php_sybase_ct.dll
;extension=php_threads.dll
;extension=php_tidy.dll
;extension=php_timezonedb.dll
;extension=php_translit.dll
;extension=php_win32ps.dll
;extension=php_win32scheduler.dll
;extension=php_win32service.dll
;extension=php_win32std.dll
;extension=php_xdebug.dll
;extension=php_xmlreader.dll
extension=php_xmlrpc.dll
;extension=php_xmlwriter.dll
extension=php_xsl.dll
;extension=php_yaz.dll ; Module make problems
extension=php_zip.dll
;extension=php_zlib_filter.dll
 
 
the extension php_pdo.dll and php_pdo_mysql.dll are enable so what's the problem? :banghead:
I would be glad if somebody can help me through this. Thanks
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: PDO object not found in php 5.2.5

Post by Benjamin »

Is the php_pdo.dll present in the extensions directory? Have you restarted apache after uncommenting it?
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

Re: PDO object not found in php 5.2.5

Post by highjo »

Absolutely!even though i didn't change anything since the said php 5.1 ships with PDO
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PDO object not found in php 5.2.5

Post by Christopher »

Try commenting out the normal database extensions that you have enabled.
(#10850)
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

Re: PDO object not found in php 5.2.5

Post by highjo »

excuse me arborint for this question.what is it supposed to do? i mean commenting the extension
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

Re: PDO object not found in php 5.2.5

Post by highjo »

I've commented the extensions as suggested and restarted the severs but still the same error 404 object not found.I've commented them back and still.This is becoming seriuos coz i'm getting a little confused.
staar2
Forum Commoner
Posts: 83
Joined: Fri Apr 06, 2007 2:57 am

Re: PDO object not found in php 5.2.5

Post by staar2 »

use wamp then it comes by default :D
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

Re: PDO object not found in php 5.2.5

Post by highjo »

Finally i found where the problem is from.I'using the eclipse PDT for coding only and Dreamweaver for the reste design and css.I've tried running my code from dreamweaver and is it running perfectly.I'm on the verge to write to some eclipse fellas to find a solution and will post back what i've got in case someone is facing similar problem.Thank you all for the support :mrgreen:
User avatar
highjo
Forum Contributor
Posts: 118
Joined: Tue Oct 24, 2006 1:07 pm

Re: PDO object not found in php 5.2.5

Post by highjo »

PS: i'm still using XAMPP
Post Reply