Hola que tal, tengo un pequeño problema, quiero hacer una pagina maestro detalle y la pagina detalle mo me agarra la variable (o valor) que paso, uso este codigo para pasarla:
Código HTML:
<?php do { ?>
<tr>//aqui paso la id
<td><a href="detalle.php?recordID=<?php echo $row['id_']; ?>"><?php echo $row['nombre']; ?></a></td>
<td><?php echo $row['apellido']; ?> </td>
<td><?php echo $row['telefono']; ?> </td>
</tr>
<?php } while ($row = mysql_fetch_array($sql)); ?>
</table>
Pero al intentar recuperar en detalle.php no pasa nada, lo he intentado con dreamweaver utilizando juegos de registros y tampoco.
se supone que con If (isset($_GET(id_))?
este es el codigo usando DW
Código HTML:
<?php echo $row_detalle['nombre']; ?>//se supone que tiene que tomar el nombre
<?php require_once('Connections/seleccion.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_detalle = "-1";
if (isset($_GET['id_'])) {
$colname_detalle = $_GET['id_'];
}//se supone que toma el vaor enviado
mysql_select_db($database_seleccion, $seleccion);
$query_detalle = sprintf("SELECT registro.nombre FROM registro WHERE id_ = %s", GetSQLValueString($colname_detalle, "int"));
$detalle = mysql_query($query_detalle, $seleccion) or die(mysql_error());
$row_detalle = mysql_fetch_assoc($detalle);
$totalRows_detalle = mysql_num_rows($detalle);
mysql_free_result($detalle);
?>
Que me falta? o estoy muy perdido?