Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/01/2014, 15:51
Avatar de luis010182
luis010182
 
Fecha de Ingreso: julio-2009
Ubicación: Argentina - Capital Federal
Mensajes: 382
Antigüedad: 14 años, 10 meses
Puntos: 27
Respuesta: Problemas con modificar y eliminar datos mysql.

Cita:
Iniciado por Karen_mBrK Ver Mensaje
Buenas tardes.

Llevo 2 días con el mismo problema, y este es que no puedo ni modificar, ni eliminar datos desde PHP, hacía mi BD hecha en mysql. Soy un poco novata en todo esto, y les agradecería que me ayudasen.

Aquí mis códigos:

Esta es donde cargo el listado de mis registros:

<?php require_once('Connections/Pharma.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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_listado = 10;
$pageNum_listado = 0;
if (isset($_GET['pageNum_listado'])) {
$pageNum_listado = $_GET['pageNum_listado'];
}
$startRow_listado = $pageNum_listado * $maxRows_listado;

mysql_select_db($database_Pharma, $Pharma);
$query_listado = "SELECT usuarios.CURP, Nombre, Apellido_P, Apellido_M, RFC, Telefono, Celular, email, Plaza, Fecha_Inicio, nomina, ns_celular, ns_tablet, ns_pc, domicilio FROM usuarios inner join login inner join pagos inner join equipo_trabajo WHERE usuarios.CURP = login.Curp AND usuarios.curp = equipo_trabajo.curp AND usuarios.curp = pagos.curp";
$query_limit_listado = sprintf("%s LIMIT %d, %d", $query_listado, $startRow_listado, $maxRows_listado);
$listado = mysql_query($query_limit_listado, $Pharma) or die(mysql_error());
$row_listado = mysql_fetch_assoc($listado);

if (isset($_GET['totalRows_listado'])) {
$totalRows_listado = $_GET['totalRows_listado'];
} else {
$all_listado = mysql_query($query_listado);
$totalRows_listado = mysql_num_rows($all_listado);
}
$totalPages_listado = ceil($totalRows_listado/$maxRows_listado)-1;
?>

<body>


<table width="544" height="661" border="0" align="center">
<tr>
<td>&nbsp;</td>

<td><table width="200" border="1">

<?php do { ?>
<tr>
<td><?php echo $row_listado['CURP']; ?></td>
<td><?php echo $row_listado['Nombre']; ?></td>
<td><?php echo $row_listado['Apellido_P']; ?></td>
<td><?php echo $row_listado['RFC']; ?></td>
<td><?php echo $row_listado['Telefono']; ?></td>
<td><?php echo $row_listado['Celular']; ?></td>
<td><a href="modificar.php?curpm<?php echo $row_listado['CURP']; ?>">Editar</a></td>
<td><a href="eliminar_confir.php?curpe<?php echo $row_listado['CURP']; ?>">Eliminar</a></td>
</tr>
<?php } while ($row_listado = mysql_fetch_assoc($listado)); ?>
</table></td>
<td>&nbsp;</td>
</tr>
</table>

<?php
mysql_free_result($listado);
?>



Espero y puedan ayudarme.
Aca me parece que te falta el =

<td><a href="modificar.php?curpm=<?php echo $row_listado['CURP']; ?>">Editar</a></td>
<td><a href="eliminar_confir.php?curpe=<?php echo $row_listado['CURP']; ?>">Eliminar</a></td>