ErikMM Posted May 16, 2010 Share Posted May 16, 2010 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 More sharing options...
public-image Posted May 16, 2010 Share Posted May 16, 2010 Why not just update your Database details and delete that include/require Link to comment https://forums.phpfreaks.com/topic/201920-dbphp-question/#findComment-1058998 Share on other sites More sharing options...
dirkers Posted May 16, 2010 Share Posted May 16, 2010 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 More sharing options...
public-image Posted May 16, 2010 Share Posted May 16, 2010 Sorry I wouldnt know that much Im a MYSQL person the others have never really bothered me and I don't know if they are much better or just as much a pain as the others Link to comment https://forums.phpfreaks.com/topic/201920-dbphp-question/#findComment-1059024 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.