Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/06/2008, 16:56
Avatar de arko
arko
 
Fecha de Ingreso: octubre-2005
Ubicación: Sevilla (España)
Mensajes: 79
Antigüedad: 18 años, 7 meses
Puntos: 0
Respuesta: Problema al mostrar datos de SQL

Te muestro las consultas:
Código PHP:
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$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_apuntk 10;
$pageNum_apuntk 0;
if (isset(
$_GET['pageNum_apuntk'])) {
  
$pageNum_apuntk $_GET['pageNum_apuntk'];
}
$startRow_apuntk $pageNum_apuntk $maxRows_apuntk;

mysql_select_db($database_apuntek$apuntek);
$query_apuntk "SELECT * FROM categorias right JOIN actualizacion USING(id) ORDER BY categorias.id";
$query_limit_apuntk sprintf("%s LIMIT %d, %d"$query_apuntk$startRow_apuntk$maxRows_apuntk);
$apuntk mysql_query($query_limit_apuntk$apuntek) or die(mysql_error());
$row_apuntk mysql_fetch_assoc($apuntk);

if (isset(
$_GET['totalRows_apuntk'])) {
  
$totalRows_apuntk $_GET['totalRows_apuntk'];
} else {
  
$all_apuntk mysql_query($query_apuntk);
  
$totalRows_apuntk mysql_num_rows($all_apuntk);
}
$totalPages_apuntk ceil($totalRows_apuntk/$maxRows_apuntk)-1;
?>
y Como la muestro:
Código HTML:
<div id="not">
 <?php echo $row_apuntk['id']; ?> - <?php echo $row_apuntk['id_c']; ?><br />
 
 <?php echo $row_apuntk['contenido']; ?>, por <?php echo $row_apuntk['autor']; ?><br />
 
 <?php echo $row_apuntk['disminutivo']; ?>, de <?php echo $row_apuntk['descripcion']; ?>
 </div> 
Ojalá den con el problema, si es necesario envio los archivos importantes.
Salu2
__________________
Lalala Estudio| Diseño y programación web.

Si buscas con quien aprender, o con quien formar un grupo de trabajo, cuenta conmigo. Contacta ;)