Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/04/2011, 13:06
alepa
 
Fecha de Ingreso: marzo-2011
Ubicación: bs as
Mensajes: 26
Antigüedad: 13 años, 1 mes
Puntos: 0
Problema con juegos de registro PHP y MYSQL

Hola buenas tardes,
Estoy haciendo un catálogo en php donde los productos están insertados en la base de datos MYSQL. La idea es que al hacer click en la imagen del producto te lleve a la pag con el detalle de dicho producto. Esto ya lo pude realizar con los registros desde el DW pero el problema q tengo es que no importa el producto al q haga clik siempre me trae la misma info q corresponde primero q está en la tabla de la Base de datos.
Si alguien me puede ayudar
Muchas gracias!!

codigo

Código PHP:
Ver original
  1. <?php require_once('Connections/BDCatalogo.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33.  
  34. $colname_Recordset1 = "-1";
  35. if (isset($_GET['id_producto'])) {
  36.   $colname_Recordset1 = $_GET['id_producto'];
  37. }
  38. mysql_select_db($database_BDCatalogo, $BDCatalogo);
  39. $query_Recordset1 = sprintf("SELECT * FROM detalle_producto WHERE id_producto = %s", GetSQLValueString($colname_Recordset1, "int"));
  40. $Recordset1 = mysql_query($query_Recordset1, $BDCatalogo) or die(mysql_error());
  41. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  42. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  43. ?>