Ver Mensaje Individual
  #8 (permalink)  
Antiguo 14/12/2009, 07:08
visona
 
Fecha de Ingreso: febrero-2008
Mensajes: 675
Antigüedad: 16 años, 3 meses
Puntos: 5
Respuesta: Comenatrios debajo del registro

Perdona pero no me aclaro con tu codigo. Te coloco aqui el codigo que tengo y si puedes me gustaria que me dijeras como colocarlo segun este codigo, que es mas o menos el que controlo un poco.
Código PHP:
<?php require_once('../Connections/noscasa.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$maxRows_citas 10;
$pageNum_citas 0;
if (isset(
$_GET['pageNum_citas'])) {
  
$pageNum_citas $_GET['pageNum_citas'];
}
$startRow_citas $pageNum_citas $maxRows_citas;

mysql_select_db($database_noscasa$noscasa);
$query_citas "SELECT * FROM piensas, gente WHERE piensas.piusuario=gente.id_gente ORDER BY  id_piensas DESC";
$query_limit_citas sprintf("%s LIMIT %d, %d"$query_citas$startRow_citas$maxRows_citas);
$citas mysql_query($query_limit_citas$noscasa) or die(mysql_error());
$row_citas mysql_fetch_assoc($citas);

if (isset(
$_GET['totalRows_citas'])) {
  
$totalRows_citas $_GET['totalRows_citas'];
} else {
  
$all_citas mysql_query($query_citas);
  
$totalRows_citas mysql_num_rows($all_citas);
}
$totalPages_citas ceil($totalRows_citas/$maxRows_citas)-1;

mysql_select_db($database_noscasa$noscasa);
$query_comenta "SELECT * FROM comentarios, piensas, gente WHERE comentarios.idpiensas=piensas.id_piensas AND comentarios.cousuario=gente.id_gente";
$comenta mysql_query($query_comenta$noscasa) or die(mysql_error());
$row_comenta mysql_fetch_assoc($comenta);
$totalRows_comenta mysql_num_rows($comenta);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>

<body>
<?php do { ?>
  <p><?php echo $row_citas['piensas']; ?><?php echo $row_citas['nombre']; ?> <?php echo $row_citas['apellidos']; ?></p>
  <?php } while ($row_citas mysql_fetch_assoc($citas)); ?>
<?php 
do { ?>
  <p><?php echo $row_comenta['cocomenatario']; ?> <?php echo $row_comenta['nombre']; ?> <?php echo $row_comenta['apellidos']; ?></p>
    <?php } while ($row_comenta mysql_fetch_assoc($comenta)); ?>
</body>
</html>
<?php
mysql_free_result
($citas);

mysql_free_result($comenta);
?>
Aqui lo que hago primero es repetir 10 veces los datos de la tabla "piensas" y lo que no se hacer es colocar los registros de la tabla comentario debajo de cada uno de sus citas.
Gracias de nuevo