MySQL Forums
Forum List  »  PHP

Re: php query works from localhost, does not work from Windows server
Posted by: Ron Enderland
Date: January 23, 2006 04:26AM

First off, I apologize for my ignorance. I wear a lot of hats in our small shop, and I let Dreamweaver do my coding behind the scenes to make connections. Klunky, I know, but it allows me to create great web apps while I'm busy with other stuff.

Here's the contents of the connection file:

<?php
# PHP ADODB document - made with PHAkt
# FileName="Connection_php_adodb.htm"
# Type="ADODB"
# HTTP="true"
# DBTYPE="mysql"

$MM_tdseminars_HOSTNAME = '10.30.15.62';
$MM_tdseminars_DATABASE = 'mysql:tdseminars';
$MM_tdseminars_DBTYPE = preg_replace('/:.*$/', '', $MM_tdseminars_DATABASE);
$MM_tdseminars_DATABASE = preg_replace('/^[^:]*?:/', '', $MM_tdseminars_DATABASE);
$MM_tdseminars_USERNAME = 'mac_user';
$MM_tdseminars_PASSWORD = 'xxxxxxxxx';
$MM_tdseminars_LOCALE = 'En';
$MM_tdseminars_MSGLOCALE = 'En';
$MM_tdseminars_CTYPE = 'P';
$KT_locale = $MM_tdseminars_MSGLOCALE;
$KT_dlocale = $MM_tdseminars_LOCALE;
$KT_serverFormat = '%Y-%m-%d %H:%M:%S';
$QUB_Caching = 'false';

$KT_localFormat = $KT_serverFormat;

if (!defined('CONN_DIR')) define('CONN_DIR',dirname(__FILE__));
require_once(CONN_DIR.'/../adodb/adodb.inc.php');
$tdseminars=&KTNewConnection($MM_tdseminars_DBTYPE);

if($MM_tdseminars_DBTYPE == 'access' || $MM_tdseminars_DBTYPE == 'odbc'){
if($MM_tdseminars_CTYPE == 'P'){
$tdseminars->PConnect($MM_tdseminars_DATABASE, $MM_tdseminars_USERNAME,$MM_tdseminars_PASSWORD);
} else $tdseminars->Connect($MM_tdseminars_DATABASE, $MM_tdseminars_USERNAME,$MM_tdseminars_PASSWORD);
} else if (($MM_tdseminars_DBTYPE == 'ibase') or ($MM_tdseminars_DBTYPE == 'firebird')) {
if($MM_tdseminars_CTYPE == 'P'){
$tdseminars->PConnect($MM_tdseminars_HOSTNAME.':'.$MM_tdseminars_DATABASE,$MM_tdseminars_USERNAME,$MM_tdseminars_PASSWORD);
} else $tdseminars->Connect($MM_tdseminars_HOSTNAME.':'.$MM_tdseminars_DATABASE,$MM_tdseminars_USERNAME,$MM_tdseminars_PASSWORD);
}else {
if($MM_tdseminars_CTYPE == 'P'){
$tdseminars->PConnect($MM_tdseminars_HOSTNAME,$MM_tdseminars_USERNAME,$MM_tdseminars_PASSWORD, $MM_tdseminars_DATABASE);
} else $tdseminars->Connect($MM_tdseminars_HOSTNAME,$MM_tdseminars_USERNAME,$MM_tdseminars_PASSWORD, $MM_tdseminars_DATABASE);
}

if (!function_exists('updateMagicQuotes')) {
function updateMagicQuotes($HTTP_VARS){
if (is_array($HTTP_VARS)) {
foreach ($HTTP_VARS as $name=>$value) {
if (!is_array($value)) {
$HTTP_VARS[$name] = addslashes($value);
} else {
foreach ($value as $name1=>$value1) {
if (!is_array($value1)) {
$HTTP_VARS[$name1][$value1] = addslashes($value1);
}
}
}
}
}
return $HTTP_VARS;
}

if (!get_magic_quotes_gpc()) {
$_GET = updateMagicQuotes($_GET);
$_POST = updateMagicQuotes($_POST);
$_COOKIE = updateMagicQuotes($_COOKIE);
}
}
if (!isset($_SERVER['REQUEST_URI']) && isset($_ENV['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_ENV['REQUEST_URI'];
}
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'].(isset($_SERVER['QUERY_STRING'])?"?".$_SERVER['QUERY_STRING']:"");
}
?>

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.