Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/01/2010, 22:05
pilucho
 
Fecha de Ingreso: noviembre-2004
Ubicación: NULL
Mensajes: 652
Antigüedad: 19 años, 5 meses
Puntos: 6
Respuesta: porque razon no puedo extraer la informacion de la base de datos con mi pa

Hola

El problema es la programacion no uses esa conexion, cambia tu conexion que tienes por esta.

Código PHP:
<?php
// llamares a esta conexion "DB.php"
// cambia los datos por el original
$dbhost 'localhost';  // localhost
$dbuser 'usuario'// Nombre de Usuario
$dbpass 'contraeña';   // Contraseña
$dbdatabase 'DB'// Base de datos
mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error());
mysql_select_db($dbdatabase) or die(mysql_error());
?>



Copia y pega en tu sitio web y no tendras problema las conexion estan cambiadas para que agarre bien.





Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>
            Hello Moto - Moto
        </title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link rel="stylesheet" type="text/css" href="CSS/Menu-Tab.css" />
    </head>
    <body bgcolor="#000000" topmargin="0">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
        function PonerPrecio(Moto) {
            <?
            
include("PHP/DB.php"); // Aqui esta tu conexion
            
mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error());
            
mysql_select_db($dbdatabase) or die(mysql_error());
            if(
$rst3 mysql_query("SELECT nId, xNombre, nPrecio, bAgotado FROM gMotoModelo WHERE nTipo = " $Tipo " AND bActivo = 1 ORDER BY nId")) {
                while(
$rst3_reg mysql_fetch_array($rst3)) {
                    
//if($rst4 = mysql_query("SELECT xPlazo1 FROM gBancoPlazo WHERE nBanco = 1 AND nModelo = '" . $rst3_reg["nId"] . "'", $db_conexion)) {
                    //    if($rst4_reg = mysql_fetch_array($rst4)) {
                            
?>
                            if(Moto==<? echo($rst3_reg["nId"]); ?>) {
                                VP_Precio.innerText = "$<? echo($rst3_reg["nPrecio"]); ?>";
                                VP.src = "imagen/VP_<? echo($rst3_reg["xNombre"]); ?>.gif";
                                if( <? echo($rst3_reg["bAgotado"]); ?> == 1 ) {
                                    VP_Agotado.innerText = "Agotada";
                                } else {
                                    VP_Agotado.innerText = "";
                                }
                            };
                            <?
                    
//    }
                    //} else {
                    //    echo "Error en consulta 1<br>";
                    //}
                
}
            } else {
                echo 
"Error en consulta 2<br>";
            }
            
?>
        }
    -->
    </SCRIPT>
        <table width="181" height="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="right">
            <tr>
                <td width="181" bgcolor="000000" valign="top">
                    <?
                    
//include("PHP/DB.php");
                    
if($rst mysql_query("SELECT nId, xTipo FROM gMotoModeloTipo ORDER BY nId")) {
                        
?>
                        <div id="menu-lat-enc"> 
                            <ul>
                                <?
                                
while($rst_reg mysql_fetch_array($rst)) {
                                    
?>
                                    <li> <a href="moto_menu.php?Tipo=<? echo($rst_reg["nId"]); ?>" target="Moto-Menu"> <? echo($rst_reg["xTipo"]); ?> </a> </li>
                                    <?
                                    
if( $rst_reg["nId"] == $Tipo ) {
                                        if(
$rst2 mysql_query("SELECT nId, xNombre FROM gMotoModelo WHERE nTipo = " $Tipo " AND bActivo = 1 ORDER BY nId")) {
                                            
?>
                                            </ul></div>
                                            <div id="menu-lat"> 
                                                <ul>
                                                    <?
                                                    
while($rst2_reg mysql_fetch_array($rst2)) {
                                                        
?>
                                                        <li> <a href="moto_desglose.php?Id=<? echo($rst2_reg["nId"]); ?>&Objeto=1" target="Moto-Desglose" onMouseOver="PonerPrecio(<? echo($rst2_reg["nId"]); ?>);"> <? echo($rst2_reg["xNombre"]); ?> </a> </li>
                                                        <?
                                                    
}
                                                    
?>
                                                </ul>
                                            </div>
                                            <div id="menu-lat-enc"><ul>
                                            <?    
                                        
} else {
                                            echo 
"Error en consulta<br>";
                                        }
                                    }
                                }
                                
?>
                            </ul>
                        </div>
                        <?    
                    
} else {
                        echo 
"Error en consulta<br>";
                    }
                    
?>
                    <div align="center">
                        <img src="imagen/VP_Logo.gif" name="VP" width="120" height="90" border="0" id="VP">
                        <font color="#FFFFFF">
                            <br><span id=VP_Precio></span>
                            <br><span id=VP_Agotado></span>
                        </font>
                    </div>
                </td>
            </tr>
        </table>
    </body>
</html>