Foros del Web » Programando para Internet » PHP »

Lectura de datos

Estas en el tema de Lectura de datos en el foro de PHP en Foros del Web. Saludos, anteriormente les presente un catalogo de productos q desarrolle, pues solo era el panel de control.. ahora bien cuando trato de crear la hoja ...
  #1 (permalink)  
Antiguo 27/09/2007, 12:42
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Lectura de datos

Saludos, anteriormente les presente un catalogo de productos q desarrolle, pues solo era el panel de control.. ahora bien cuando trato de crear la hoja donde deben estar las productos con vinculos para entrar a la descripcion de cada uno esta al probarla no me muestra el contenido... aqui les muestro deberian salir asi

Categoria
producto

Categoria
producto

Código PHP:
<?php require_once('Connections/listproduc.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;
}
}

$colname_Recordset1 "-1";
if (isset(
$_GET['nombre'])) {
  
$colname_Recordset1 $_GET['nombre'];
}
mysql_select_db($database_listproduc$listproduc);
$query_Recordset1 sprintf("SELECT * FROM categoria WHERE nombre = %s ORDER BY PKID ASC"GetSQLValueString($colname_Recordset1"text"));
$Recordset1 mysql_query($query_Recordset1$listproduc) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?><!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>Untitled Document</title>
</head>

<body>
<?php echo $row_Recordset1['nombre']; ?>
</body>
</html>
<?php
mysql_free_result
($Recordset1);
?>
aqui solo trato de agarrar la categoria a ver si me la muestra y nada!!!
  #2 (permalink)  
Antiguo 27/09/2007, 13:33
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Re: Lectura de datos

disculpen vuelva a escribir pero desarrolle otro codigo y me da un error

Parse error: syntax error, unexpected '}' in C:\wamp\www\Ocean\Web\inc_cat_list_pro.php on line 51

Código PHP:
<?php 
include ('Connections/listproduc.php');
$sql="SELECT * FROM categoria";
$sql_exec=mysql_query($sql);
?>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
}
-->
</style>
<link href="estilos.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
<table width="54%" border="0" align="left" cellpadding="0" cellspacing="2" bordercolor="#EBEBEB" class="letrasform2">
  <?php
        
while($row=mysql_fetch_array($sql_exec)){
        
$Id_categoria=$row['PKID'];
        
$categoria=$row['nombre'];
        
?>
  <tr bgcolor="#F4F4F4" class="style3">
    <td width="116" height="10" bgcolor="#FFFFFF" class="ngr_tah"><div align="left" class="style4">
      <br />
      <br />
      <br />
    </div></td>
    <td width="30" height="10" bgcolor="#FFFFFF" class="ngr_tah"><span class="style4">
      <?=$row['nombre']?>
    </span></td>
    <td height="10" bgcolor="#FFFFFF" class="ngr_tah">&nbsp;</td>
    <td height="10" bgcolor="#FFFFFF" class="ngr_tah">&nbsp;</td>
  </tr>
  
  <?php $sqlexz="SELECT * FROM producto WHERE PKID=".$rowex['PKIDCAT'];
        
$sql_execexz=mysql_query($sqlexz);
        while(
$rowexz=mysql_fetch_assoc($sql_execexz))?>
  <tr bgcolor="#E5E5E5" class="style3">
    <td height="20" bgcolor="#FFFFFF" class="azulgris_verd_nrm style1">&nbsp;</td>
    <td height="20" bgcolor="#FFFFFF" class="azulgris_verd_nrm style1">&nbsp;</td>
    <td width="21" height="20" bgcolor="#FFFFFF" class="azulgris_verd_nrm style1">&nbsp;</td>
    <td width="499" bgcolor="#FFFFFF" class="azulgris_verd_nrm"><a href="ficha_prod.php?PKID=<?=$rowexz['PKID']?>">
      <?=$rowexz['nombre']?>
    </a></td>
  </tr>
  <?php }?>
  <?php }?> //<---- Linea 51  --->//
  <?php }?> 
</table>
<br />
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 19:15.