Foros del Web » Programando para Internet » PHP »

Problema al enviar ID en vinculo

Estas en el tema de Problema al enviar ID en vinculo en el foro de PHP en Foros del Web. tengo una galeria de productos en la cual asigno un link a la imagen para ir a su fichar tecnica no me envia el id ...
  #1 (permalink)  
Antiguo 10/01/2008, 13:26
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Pregunta Problema al enviar ID en vinculo

tengo una galeria de productos en la cual asigno un link a la imagen para ir a su fichar tecnica no me envia el id .. lo envia vacio

da algo como
www.dominio.com/ficha_prod.php?id=

pero no envia el valor... alguien podria ayudarme a ver el error?

mi codigo
Código PHP:
<?php require_once('Connections/incomed.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_Recordset1 9;
$pageNum_Recordset1 0;
$columnes_Recordset1 4;
if (isset(
$_GET['pageNum_Recordset1'])) {
  
$pageNum_Recordset1 $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 $pageNum_Recordset1 $maxRows_Recordset1;

mysql_select_db($database_incomed$incomed);
$query_Recordset1 "SELECT imgprinc FROM ambulancias ORDER BY id ASC";
$query_limit_Recordset1 sprintf("%s LIMIT %d, %d"$query_Recordset1$startRow_Recordset1$maxRows_Recordset1);
$Recordset1 mysql_query($query_limit_Recordset1$incomed) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);

if (isset(
$_GET['totalRows_Recordset1'])) {
  
$totalRows_Recordset1 $_GET['totalRows_Recordset1'];
} else {
  
$all_Recordset1 mysql_query($query_Recordset1);
  
$totalRows_Recordset1 mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>

/* otra parte mas abajo */

<?php do { ?>
                              <tr>
                                <td>&nbsp;</td>
                                <td><a href="ficha_prod.php?id=<?php echo $row_Recordset1['id']; ?>"><img src="images8/<?php echo $row_Recordset1['imgprinc']; ?>" width="160" height="139" border="0" /></a></td>
                              </tr>
                              <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>

<?php
mysql_free_result
($Recordset1);
?>
  #2 (permalink)  
Antiguo 10/01/2008, 13:37
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Problema al enviar ID en vinculo

Comprueba que exista $row_Recordset1['id'], ya que al parecer es por eso que no se esta imprimiendo.

Saludos.
  #3 (permalink)  
Antiguo 10/01/2008, 13: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
Re: Problema al enviar ID en vinculo

ficha_prod.php?id=<?php echo $row_Recordset1['id']; ?>

en este vindulo es url?id=<?php echo $esto seria?[id'];?>
  #4 (permalink)  
Antiguo 10/01/2008, 13:54
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Problema al enviar ID en vinculo

Haz un var_dump a $row_Recordset1 para que veas que elementos tiene.

Saludos.
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 18:39.