Foros del Web » Programando para Internet » PHP »

[AYUDA, Urgente] error borrando o editando contenidos

Estas en el tema de [AYUDA, Urgente] error borrando o editando contenidos en el foro de PHP en Foros del Web. Saludos, Tngo un panel de control el cual me muestra una lista de articulos y me da la opcion de editar o borrar.... ahora, cuando ...
  #1 (permalink)  
Antiguo 08/11/2007, 14:35
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
[AYUDA, Urgente] error borrando o editando contenidos

Saludos,
Tngo un panel de control el cual me muestra una lista de articulos y me da la opcion de editar o borrar.... ahora, cuando voy a hacerle click no me agarra los articulos es decir no extrae el id de la base de datos... alguien podria ayudarme?

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;
}
}

$maxRows_Recordset1 10;
$pageNum_Recordset1 0;
if (isset(
$_GET['pageNum_Recordset1'])) {
  
$pageNum_Recordset1 $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 $pageNum_Recordset1 $maxRows_Recordset1;

mysql_select_db($database_listproduc$listproduc);
$query_Recordset1 "SELECT * FROM noticias";
$query_limit_Recordset1 sprintf("%s LIMIT %d, %d"$query_Recordset1$startRow_Recordset1$maxRows_Recordset1);
$Recordset1 mysql_query($query_limit_Recordset1$listproduc) 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;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo16 {color: #FFFFFF}
-->
</style>
<link href="../../css/estilo.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
function validar_archivo(archivo) {
    var error_archivo;
    error_archivo=0;
      var file=archivo.value;
      
          if (file=="")
          { error_archivo=1; }
          //texto += "\n\nIngrese Foto"
            else{
             
                 // file=document.formulario.FOTO.value
               extArray = new Array(".gif",".jpg");
               // Extension de archivos permitidos
               allowSubmit = false;
                 if (!file) return;

                   while (file.indexOf("\\") != -1)
                       file = file.slice(file.indexOf("\\") + 1);
                       ext = file.slice(file.indexOf(".")).toLowerCase();
                   
                   for (var i=0; i < extArray.length; i++){
                          if (extArray[i] == ext){
                             allowSubmit = true;
                             break;
                            }
                    }

                        if (!allowSubmit) {
                         error_archivo=2;
                        // texto += "\n\nFOTO: solo admite archivo con la extensión ''gif, .jpeg , .jpg''";
                         }
                            }
                            return error_archivo;
}



</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #000000}
.style4 {font-weight: bold}
.style2 {font-weight: bold}
.style3 {    font-weight: normal
}
-->
</style>
</head>

<body>
<div align="center">
  <TABLE height=243 cellSpacing=0 cellPadding=0 width=698 
background=../../images2/img/med.gif border=0>
    <CENTER>
      <TBODY>
        <TR>
          <TD width="100%" height=50 align="left" valign="top"><img src="../../images/panel.jpg" width="698" height="100"></TD>
        </TR>
    </CENTER>
    <CENTER>
    </CENTER>
    <TR>
      <TD width="100%" height=160 vAlign=top>
        <TABLE width=698 border=0 cellPadding=0 cellSpacing=0 bordercolor="#FF0000" id=table2>
          <TBODY>
            <TR>
              <TD width="8" vAlign=top > </TD>
              <TD width="156" vAlign=top class="nucomplet" ><?php include("../modulos/indexbarra.php"); ?>
              </TD>
              <TD width=10 vAlign=top> </TD>
              <TD width=13 vAlign=top> </TD>
              <TD width=498 align="center" vAlign=middle class="nucomplet"><span class="unnamed1"><a href="ingresar.php"> Insertar Noticias </a><span class="style1">-</span><a href="listado.php"> Administrar Noticias</a></span>
                <table width="552" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="700" height="242"><p>&nbsp;</p>
                        <table width="400" border="0" align="center" cellpadding="0" cellspacing="0" class="text">
                          <tr>
                            <td class="negro_verd_nrm"><div align="center"><strong>
                              <?=$msj?>
                            </strong></div></td>
                          </tr>
                        </table>
                      <br />
                        <table width="473" height="16" border="0" align="center" cellpadding="0" cellspacing="0" class="text">
                          <tr>
                            <td width="10">&nbsp;</td>
                            <td width="690" class="negro_verd_nrm"><span class="azulgrs_tah"><strong>Listado de Noticias:</strong></span></td>
                          </tr>
                        </table>
                      <br />
                        <table width="536" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="537"><table width="467" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EBEBEB" class="text">
                            </table></td>
                          </tr>
                        </table>
                        <table width="467" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EBEBEB" class="text">
                          <tr class="azulgrs_tah">
                            <td width="110" class="style3"><div align="center" class="style3"><strong>Titulo</strong></div></td>
                            <td width="254"><div align="center"><span class="style3 style1 style2"><strong>Contenido</strong></span></div></td>
                          </tr>
                          <tr class="negro_verd_nrm">
                            <td height="20" colspan="3" class="azulgrs_tah"><?php do { ?>
                              <table width="467" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EBEBEB" class="text">
                              
                                <tr class="negro_verd_nrm">
                                  <td width="110" height="20" class="azulgrs_tah"><div align="center" class="style3 style100"><?php echo $row_Recordset1['titulo']; ?></div></td>
                                  <td width="254" class="azulgrs_tah"><div align="center"><?php echo $row_Recordset1['contenido']; ?></div></td>
                                  <td width="95"><div align="center" class="style3 style100"><span class="style101"><?php echo "<a href='edita_noticias.php?id=".$row['id']."'>Editar</a>"?> / <?php echo "<a href='borra_noticias.php?id=".$row['id']."'>Borrar</a>"?> </span></div></td>
                                </tr>
                                                                </table>
                                <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?></td>
                          </tr>
                        </table>                      <p>&nbsp;</p></td>
                  </tr>
                </table></TD>
              <TD width=13 vAlign=top>&nbsp;</TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
    <TR>
      <TD width="100%" height=33 valign="top" bgcolor="#FFFFFF" class="Estilo16">&nbsp;</TD>
    </TR>
  </TABLE>
</div>
<p align="center">&nbsp;</p>
</body>
</html>
<?php
mysql_free_result
($Recordset1);
?>
  #2 (permalink)  
Antiguo 08/11/2007, 14:42
Avatar de Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 2 meses
Puntos: 81
Re: [AYUDA, Urgente] error borrando o editando contenidos

Porque usas:
Código PHP:
".$row['id']." 
y antes usas
Código PHP:
$row_Recordset1['contenido']; 
Tienes 2 recordset '???

Suerte
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!
  #3 (permalink)  
Antiguo 08/11/2007, 14:44
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: [AYUDA, Urgente] error borrando o editando contenidos

1 solo recordset... la cosa es q no hace nada!!!!!... no me extrae el id par yo poder editar o borrar contenidos!!!!!
  #4 (permalink)  
Antiguo 08/11/2007, 14:53
Avatar de Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 2 meses
Puntos: 81
Re: [AYUDA, Urgente] error borrando o editando contenidos

Por eso... si tienes un solo recordset Y te muestra el contenido, cambia esto:
Código PHP:
".$row['id']." 
Por:
Código PHP:
".$row_Recordset1['id']." 
Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!
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 16:17.