Jump to content

DB.php question


ErikMM

Recommended Posts

I have a script called webadmin, which stores orders and emails in MySQL.

 

I'm moving it across servers, and run into a problem.

 

The index.php calls on /includes/connect.php, which is as below. On the original server, no DB.php is even present, and it works like a charm. On the new server, the scripts are the same and the config is altered to reflect the new MySQL settings, but it reported DB.php as missing (again, not even present @ old server). I downloaded it from php.net, but once in place it says "DB error: not found", while the MySQL database is created.

 

Anyone with thoughts?

 

----

 

<?php

$link = mysql_connect ("$server", "$user", "$pass")

      or die("Geen connectie met mySql op" . $dbserver . " mogelijk");

  $db = mysql_select_db($dbnaam,$link)

    or die("Kan " . $dbnaam . " op " . $dbserver . " niet openen.");

 

require_once("DB.php");

$dsn = array(

    'phptype'  => 'mysql',

    'username' => $user,

    'password' => $pass,

    'hostspec' => $server,

    'database' => $dbnaam,

);

$db =& DB::connect($dsn);

if (PEAR::isError($db)) {

    die($db->getMessage());

} else {

$db->setFetchMode(DB_FETCHMODE_ASSOC);

}

?>

Link to comment
https://forums.phpfreaks.com/topic/201920-dbphp-question/
Share on other sites

Looks like your script is using PEAR's DB Package. Since it is being included via require_once(), I don't think your script would have run without finding DB.php. In other words, your old server had the PEAR's DB Package installed and your new server will have to as well. The package was probably installed in a directory external to your project, which is why you didn't find it.

Link to comment
https://forums.phpfreaks.com/topic/201920-dbphp-question/#findComment-1059022
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.