Page 1 of 1

PDO object not found in php 5.2.5

Posted: Sat Feb 16, 2008 4:25 pm
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

Re: PDO object not found in php 5.2.5

Posted: Sat Feb 16, 2008 4:27 pm
by Benjamin
Is the php_pdo.dll present in the extensions directory? Have you restarted apache after uncommenting it?

Re: PDO object not found in php 5.2.5

Posted: Sat Feb 16, 2008 4:47 pm
by highjo
Absolutely!even though i didn't change anything since the said php 5.1 ships with PDO

Re: PDO object not found in php 5.2.5

Posted: Sat Feb 16, 2008 4:55 pm
by Christopher
Try commenting out the normal database extensions that you have enabled.

Re: PDO object not found in php 5.2.5

Posted: Sat Feb 16, 2008 5:01 pm
by highjo
excuse me arborint for this question.what is it supposed to do? i mean commenting the extension

Re: PDO object not found in php 5.2.5

Posted: Mon Feb 18, 2008 10:52 am
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.

Re: PDO object not found in php 5.2.5

Posted: Mon Feb 18, 2008 11:11 am
by staar2
use wamp then it comes by default :D

Re: PDO object not found in php 5.2.5

Posted: Mon Feb 18, 2008 4:06 pm
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:

Re: PDO object not found in php 5.2.5

Posted: Mon Feb 18, 2008 4:07 pm
by highjo
PS: i'm still using XAMPP