You are here: PEAR newbie trying to user PEAR DB and falling at the first hurdle « PHP Programming Language « IT news, forums, messages
PEAR newbie trying to user PEAR DB and falling at the first hurdle

Posted by bizt on 12/03/07 04:08

Hi,

Ive just installed PEAR on my local machine and all is well, updated
the include_path to point to my PEAR dir. So, when I just try to make
a simple connection like so the script just seems to stop but no error
messsages. I do get error messages normally (ie. when I can a method
from an object that doesnt actually exist) as I have set
display_errors = On in php.ini.

Anyway, heres my code:

<?php

include('PEAR/DB/DB.php');

$dsn = "mysqli://root:password@localhost/testdb";
$conn = DB::connect($dsn);

if (DB::isError($conn)) {
print("Unable to connect to DB!!");
die($conn->getMessage());
}

?>

Btw Im using MySQL 5 so I understand that the prefix above in the DSN
should be 'mysqli'. My script just stops at theline ..

$conn = DB::connect($dsn);

... with no error messages or any indicated that there was a problem
until I place a ..

print 'Hello world!';

... after it to see where the script ends - nothing is printed. Any
ideas why this might be or how to gather some more information? Thanks

Burnsy

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация