Re: DB Not working correctly...

From: Date: Sun, 15 Jun 2003 20:39:25 +0000
Subject: Re: DB Not working correctly...
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5970@lists.php.net to get a copy of this message
Stan Lemon wrote:
To: pear-general@lists.php.net I'm new to PEAR and to the mailing list. What I need is help, using DB. DB works fine with PHP installed on my personal computer (Windows), however, on my web host (A Cpanel server) it connects, but can't run queries to that database. I have been able to use both Mail, and Mail_Mime with no problems. My code is as simple as the following: <.php include "DB.php"; $db = DB::connect("$server://$user:$password@$host/$database"); $query = "SELECT * FROM ps_config WHERE site=1"; $result = $db->query($query) or error("I could not connect to the PageSite configuration table in the SQL database."); $config = $result->fetchRow(DB_FETCHMODE_ASSOC); ?.> (Period inserted so it doesn't become code) Anyhow, the error I get is: Fatal error: Call to undefined function: query() in /home/insyder/public_html/beta/index.php on line 70 Now it doesn't matter whether or not I use my copy of DB (latest) or the copy that my host has installed on their server (not sure on ver). Can anyone help me with this? Thanks. - Stan Lemon
Hi, what kind of db driver do you use ? In your connect string, what driver represents $Server ? Are you sure that database support is correctly provided by php on your web host ? what gives you phpinfo() ? just try a Connect like that: |$db = DB::connect($dsn); if (DB::isError($db)) {
       die ($db->getMessage());
} | |it should give you back usefull informations.| || | | regards -- Xavier

« previous php.pear.general (#5970) next »