Foros del Web » Programando para Internet » PHP »

Ayuda Variables Global

Estas en el tema de Ayuda Variables Global en el foro de PHP en Foros del Web. Hola amigos tengo el siguiente problema Al momento de llamar a ala pag. del servidor web me arroja el siguieente error Fatal error: Call to ...
  #1 (permalink)  
Antiguo 07/07/2006, 16:14
Avatar de calavera  
Fecha de Ingreso: diciembre-2005
Mensajes: 113
Antigüedad: 18 años, 3 meses
Puntos: 0
Pregunta Ayuda Variables Global

Hola amigos tengo el siguiente problema

Al momento de llamar a ala pag. del servidor web me arroja el siguieente error

Fatal error: Call to undefined function: adonewconnection() in /home/sjoven/public_html/includes/pnAPI.php on line 424

Código PHP:
function pnDBInit()

    
// Get database parameters
    
$dbtype $GLOBALS['pnconfig']['dbtype'];
    
$dbhost $GLOBALS['pnconfig']['dbhost'];
    
$dbname $GLOBALS['pnconfig']['dbname'];
    
$dbuname $GLOBALS['pnconfig']['dbuname'];
    
$dbpass $GLOBALS['pnconfig']['dbpass']; 
    
$pconnect $GLOBALS['pnconfig']['pconnect'];

    
// Start connection
    
$GLOBALS['pndbconn'] =& ADONewConnection ($dbtype); [COLOR="Red"][SIZE="5"]linea 424[/SIZE][/COLOR]
    if (
$pconnect) {
        
$dbh =& $GLOBALS['pndbconn']->PConnect($dbhost$dbuname$dbpass$dbname);
    } else {
        
$dbh =& $GLOBALS['pndbconn']->Connect($dbhost$dbuname$dbpass$dbname);
    }
    if (!
$dbh) {
        
//$dbpass = "";
        //die("$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect" . $dbconn->ErrorMsg());
        
die("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>PostNuke powered Website</title>\n</head>\n<body>\n<center>\n<h1>Problem in Database Connection</h1>\n<br /><br />\n<h5>This Website is powered by PostNuke</h5>\n<a href=\"http://www.postnuke.com\" target=\"_blank\"><img src=\"images/powered/postnuke.butn.gif\" border=\"0\" alt=\"Web site powered by PostNuke\" hspace=\"10\" /></a> <a href=\"http://php.weblogs.com/ADODB\" target=\"_blank\"><img src=\"images/powered/adodb2.gif\" alt=\"ADODB database library\" border=\"0\" hspace=\"10\" /></a><a href=\"http://www.php.net\" target=\"_blank\"><img src=\"images/powered/php2.gif\" alt=\"PHP Scripting Language\" border=\"0\" hspace=\"10\" /></a><br />\n<h5>Although this site is running the PostNuke software<br />it has no other connection to the PostNuke Developers.<br />Please refrain from sending messages about this site or its content<br />to the PostNuke team, the end will result in an ignored e-mail.</h5>\n</center>\n</body>\n</html>");
    } 
    global 
$ADODB_FETCH_MODE;
    
$ADODB_FETCH_MODE ADODB_FETCH_NUM

    
// force oracle to a consistent date format for comparison methods later on
    
if (strcmp($dbtype'oci8') == 0) {
        
$GLOBALS['pndbconn']->Execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'");
    } 

    return 
true;

  #2 (permalink)  
Antiguo 09/07/2006, 19:38
Avatar de calavera  
Fecha de Ingreso: diciembre-2005
Mensajes: 113
Antigüedad: 18 años, 3 meses
Puntos: 0
Que prodia ser

Cita:
Iniciado por calavera
Hola amigos tengo el siguiente problema

Al momento de llamar a ala pag. del servidor web me arroja el siguieente error

Fatal error: Call to undefined function: adonewconnection() in /home/sjoven/public_html/includes/pnAPI.php on line 424

Código PHP:
function pnDBInit()

    
// Get database parameters
    
$dbtype $GLOBALS['pnconfig']['dbtype'];
    
$dbhost $GLOBALS['pnconfig']['dbhost'];
    
$dbname $GLOBALS['pnconfig']['dbname'];
    
$dbuname $GLOBALS['pnconfig']['dbuname'];
    
$dbpass $GLOBALS['pnconfig']['dbpass']; 
    
$pconnect $GLOBALS['pnconfig']['pconnect'];

    
// Start connection
    
$GLOBALS['pndbconn'] =& ADONewConnection ($dbtype); [COLOR="Red"][SIZE="5"]linea 424[/SIZE][/COLOR]
    if (
$pconnect) {
        
$dbh =& $GLOBALS['pndbconn']->PConnect($dbhost$dbuname$dbpass$dbname);
    } else {
        
$dbh =& $GLOBALS['pndbconn']->Connect($dbhost$dbuname$dbpass$dbname);
    }
    if (!
$dbh) {
        
//$dbpass = "";
        //die("$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect" . $dbconn->ErrorMsg());
        
die("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>PostNuke powered Website</title>\n</head>\n<body>\n<center>\n<h1>Problem in Database Connection</h1>\n<br /><br />\n<h5>This Website is powered by PostNuke</h5>\n<a href=\"http://www.postnuke.com\" target=\"_blank\"><img src=\"images/powered/postnuke.butn.gif\" border=\"0\" alt=\"Web site powered by PostNuke\" hspace=\"10\" /></a> <a href=\"http://php.weblogs.com/ADODB\" target=\"_blank\"><img src=\"images/powered/adodb2.gif\" alt=\"ADODB database library\" border=\"0\" hspace=\"10\" /></a><a href=\"http://www.php.net\" target=\"_blank\"><img src=\"images/powered/php2.gif\" alt=\"PHP Scripting Language\" border=\"0\" hspace=\"10\" /></a><br />\n<h5>Although this site is running the PostNuke software<br />it has no other connection to the PostNuke Developers.<br />Please refrain from sending messages about this site or its content<br />to the PostNuke team, the end will result in an ignored e-mail.</h5>\n</center>\n</body>\n</html>");
    } 
    global 
$ADODB_FETCH_MODE;
    
$ADODB_FETCH_MODE ADODB_FETCH_NUM

    
// force oracle to a consistent date format for comparison methods later on
    
if (strcmp($dbtype'oci8') == 0) {
        
$GLOBALS['pndbconn']->Execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'");
    } 

    return 
true;

  #3 (permalink)  
Antiguo 10/07/2006, 07:40
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
Con esa función que has sacado totalmente fuera de contexto (del código que lo llame o use) poco se te puede comentar al respecto.

Según parece ese código se nutre de "ADOdb" .. classe que tendras que tener por ahí instalada ("en algún directorio").

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:30.