Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/01/2009, 18:00
fenternet
 
Fecha de Ingreso: septiembre-2008
Mensajes: 8
Antigüedad: 15 años, 7 meses
Puntos: 0
Consultar datos de diferentes tablas en php y mysql

TENGO ESTE CODIGO:

Código PHP:
<?php
include ("includes/status.inc.php");
include (
"includes/functions.inc.php");
include (
"includes/config.php");
db_connect();

$x $_GET['user'];

if (!
$x) {
if (isset(
$_COOKIE[xeforum])) {
$d "n";
$get mysql_query("SELECT name, cedula, semestre FROM users WHERE username='$_COOKIE[xeforum]'");
$get2 mysql_query("SELECT titulo, nombre_arch FROM tbl_documentos WHERE username='$_COOKIE[xeforum]'");
$fetch mysql_fetch_row($get);
$fetch2 mysql_fetch_row($get2);
$name $fetch[0];
$cedula $fetch[1];
$semestre $fetch[2];
$titulo $fetch2[1];
$nombre_arch $fetch2[2];
}
else {
$error "Ningún usuario seleccionado para el perfil de vista!";
include (
"error.php");
exit();
}
}
else {
$get mysql_query("SELECT name, cedula, semestre FROM users WHERE username='$x'");
$get2 mysql_query("SELECT titulo, nombre_arch FROM tbl_documentos WHERE username='$x'");
$fetch mysql_fetch_row($get);
$fetch2 mysql_fetch_row($get2);
$name $fetch[0];
$cedula $fetch[1];
$semestre $fetch[2];
$titulo $fetch2[1];
$nombre_arch $fetch2[2];
}
?>

Y DESEO QUE SE VEA AQUI:

Código HTML:
<table border="1" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" bordercolor="#9999FF" cellpadding="0">
	<tr>
		<td>
			<table border="1" width="362" id="table2" style="border-collapse: collapse">
				<tr>
					<td width="144"><font face="Tahoma" style="font-size: 10pt">
					Nombre del estudiante:</font></td>
					<td align="left">
					<font face="Tahoma" size="2" color="#008000"><? echo $name; ?></font></td>
				</tr>
				<tr>
					<td width="144"><font face="Tahoma" style="font-size: 10pt">
					Año y sección:</font></td>
					<td align="left">
					<font face="Tahoma" size="2" color="#008000"><? echo $semestre; ?></font></td>
				</tr>
				<tr>
					<td width="144"><font face="Tahoma" style="font-size: 10pt">
					Materia:</font></td>
					<td align="left">
					<font face="Tahoma" size="2" color="#008000"><? echo $titulo; ?></font></td>
				</tr>
				<tr>
					<td width="144"><font face="Tahoma" style="font-size: 10pt">
					Tipo de evaluación:</font></td>
					<td align="left">
					<font face="Tahoma" size="2" color="#008000"><? echo $nombre_arch; ?></font></td>
				</tr>
			</table> 

PERO SOLO ME MUESTRA LA PRIMERA $GET = mysql_query(.......

COMO HAGO PARA QUE SE ME MUESTREN LAS DOS TABLAS EN UNA MISMA PAGINA
ME SALE ESTE ERROR CUANDO CORRE EN MI SERVIDOR:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\prueba\habilitar.php on line 15