Foros del Web » Programando para Internet » PHP »

PHP y HTML

Estas en el tema de PHP y HTML en el foro de PHP en Foros del Web. Necesito ayuda con este codigo, lo que necesito es relacionar una base de datos en mysql, pero necesito saber si este codigo esta bien, no ...
  #1 (permalink)  
Antiguo 22/05/2011, 20:42
 
Fecha de Ingreso: mayo-2011
Mensajes: 1
Antigüedad: 12 años, 11 meses
Puntos: 0
PHP y HTML

Necesito ayuda con este codigo, lo que necesito es relacionar una base de datos en mysql, pero necesito saber si este codigo esta bien, no se mucho sobre la materia pero lo ya lo intente y los campos que tienen echo, no me aparece lo que puse en la bd de mysql.

Código PHP:
<?php
    $USUARIO
=$_POST['USER'];
    
$PASWORD=$_POST['PASS'];

$conexion=mysql_connect("localhost","root","12345")  or die("Problemas en la conexion"); 
$databasemysql_select_db("siscecytem",$conexion) or die("Problemas en la seleccion de la base de datos"); 

$query_clase "SELECT USUARIO.IDUSUARIO, USUARIO.PASS, USUARIO.NOM, USUARIO.APP, USUARIO.APM, USUARIO.FOTO, PUESTOS.DESCRIP, AREAS.NOMBRE    FROM  EMPLEADO INNER JOIN USUARIO ON EMPLEADO.USUARIO=USUARIO.IDUSUARIO INNER JOIN PUESTOS ON   EMPLEADO.PUESTO=PUESTOS.IDPUESTO INNER JOIN AREAS ON EMPLEADO.AREA=AREAS.IDAREA  WHERE USUARIO.IDUSUARIO ='".$USUARIO."' AND USUARIO.PASS='".$PASSWORD."'"
$rs mysql_query($query_clase$conexion) or die(mysql_error()); 
$cuenta=mysql_num_rows($rs);
$CAMPOS=mysql_fetch_row($rs);

    

    
$NOMCOM$CAMPOS[2]." ".$CAMPOS[3]." ".$CAMPOS[4];
        
    
    
?>
<html>
<head> <title> Principal </title> </head>

<body style="margin:0px" background="9.jpg" text="white">

<center>

<table width="1200" border="0" color="white">

<tr>
    <td width="150" height="150"> <a href="principal.html"> <center> <img src="logocorp.jpg" width="150" height="150"> </center> </a> </td> 
    <td width="900"> <h1> <font color="#000" face="Segoe UI" size="7"><center>ECOBLOCKS S.A. de C.V.</center></font></h1> </td> 
    <td width="150"> <center> <img src="<? echo $CAMPOS[5]; ?>" width="120" height="150"> </center> </td> 
</tr>
    
<tr>  <td colspan="3"> <font size="4">
    
    <table width="1200" border="0" align="center">
 <tr>
    <td width="300" height="54"> <font face="Segoe UI" color="black"> DEPARTAMENTO:</font> <? echo $CAMPOS[7];?></td>
    <td width="300"> <font face="Segoe UI" color="black"> PUESTO:</font> <?  echo $CAMPOS[6]; ?> </td>
    <td width="300"> <font face="Segoe UI" color="black"> NOMBRE:</font> <? echo $NOMCOM;?> </td> 
 </tr>
    </table>
 
</tr> 

    <tr> 

    <td height="400"> <table border="0" width="200" height="400">

            <tr> <td bgcolor="#EEDFCC"> <font color="black" face="Bauhaus 93"> <center> MENÚ </center> </font> </td> </tr>

            <tr> <td bgcolor="#FFC125"> <a href="finanzas.html" target="datos" title="Finanzas"> <font color="black"> FINANZAS </font> </a> </td> </tr>

            <tr> <td bgcolor="#FF4500"> <a href="mercadotecnia.html" target="datos" title="Mercadotecnia"> <font color="black"> MERCADOTECNIA </font> </a> </td> </tr>

            <tr> <td bgcolor="#87CEFA"> <a href="sistemas.html" target="datos" title="Sistemas"> <font color="black"> SISTEMAS </font> </a> </td> </tr>

            <tr> <td bgcolor="#9ACD32"> <a href="recursosh.html" target="datos" title="Recursos Humanos"> <font color="black"> RECURSOS HUMANOS </font> </a> </td> </tr>

            <tr> <td bgcolor="#EED5D2"> <a href="produccion.html" target="datos" title="Producción"> <font color="black"> PRODUCCIÓN </font> </a> </td>  </tr>

            </table>

        </td>



    <td colspan="2"> <center> <iframe name="datos" width="1000" height="400" src="home.html" scrolling="no"> </iframe> </td>

    </tr>
 
 
</table>

</center>
 
</body>
</html>
  #2 (permalink)  
Antiguo 23/05/2011, 00:37
Avatar de arepavieja  
Fecha de Ingreso: marzo-2011
Mensajes: 207
Antigüedad: 13 años, 1 mes
Puntos: 9
Respuesta: PHP y HTML

No sé si sirva, pero suponiendo que tu consulta está bien, deberias poner el "php" después de "<?", es decir, <?php, Así como al principio.
__________________
La educación y la cortesía abren todas las puertas.

Etiquetas: html, mysql
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 21:53.