Foros del Web » Programando para Internet » PHP »

Adobe Dreamweaver "registro de Borrar"

Estas en el tema de Adobe Dreamweaver "registro de Borrar" en el foro de PHP en Foros del Web. Bueno noche hacer pagina web registro borrar es muy error "Incorrect table name '' Código HTML: <a href= "borrar.php?id=<?php echo $row_Recordset1['id']; ?>" > borrar </a> ...
  #1 (permalink)  
Antiguo 20/06/2011, 15:33
Avatar de camilo_1987  
Fecha de Ingreso: junio-2008
Ubicación: ALZIRA, Spain, Spain
Mensajes: 77
Antigüedad: 15 años, 10 meses
Puntos: 0
Adobe Dreamweaver "registro de Borrar"

Bueno noche
hacer pagina web registro borrar es muy error "Incorrect table name ''
Código HTML:
<a href="borrar.php?id=<?php echo $row_Recordset1['id']; ?>">borrar</a> 
"borrar.php"
Código PHP:
<?php require_once('Connections/sma.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;
}
}

if ((isset(
$_POST['id'])) && ($_POST['id'] != "")) {
  
$deleteSQL sprintf("DELETE FROM ``noticias-es`` WHERE id=%s",
                       
GetSQLValueString($_POST['id'], "int"));

  
mysql_select_db($database_sma$sma);
  
$Result1 mysql_query($deleteSQL$sma) or die(mysql_error());

  
$deleteGoTo "admin.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$deleteGoTo .= (strpos($deleteGoTo'?')) ? "&" "?";
    
$deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$deleteGoTo));
}

$colname_Recordset1 "-1";
if (isset(
$_GET['id'])) {
  
$colname_Recordset1 $_GET['id'];
}
mysql_select_db($database_sma$sma);
$query_Recordset1 sprintf("SELECT * FROM `noticias-es` WHERE id = %s"GetSQLValueString($colname_Recordset1"int"));
$Recordset1 mysql_query($query_Recordset1$sma) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>

<body>
<p>Nombre:<?php echo $row_Recordset1['titiulo']; ?></p>
<p>texto:<?php echo $row_Recordset1['texto']; ?></p>
<form id="form1" name="form1" method="post" action="">
  <input name="id" type="hidden" id="id" value="<?php echo $row_Recordset1['id']; ?>" />
  <input type="submit" name="button" id="button" value="Borrar" />
</form>
</body>
</html>
<?php
mysql_free_result
($Recordset1);
?>
  #2 (permalink)  
Antiguo 20/06/2011, 15:40
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 9 meses
Puntos: 1532
Respuesta: Adobe Dreamweaver "registro de Borrar"

favor explicar mejor no entender léxico, usar gramática coherente.

revisar archivo conexión, buscar tabla existe, tener ` repetido, deber:

DELETE FROM `noticias-es` WHERE id=%s
__________________
¡Por favor!: usa el highlight para mostrar código
El que busca, encuentra...
  #3 (permalink)  
Antiguo 20/06/2011, 15:44
Avatar de saseisa  
Fecha de Ingreso: agosto-2006
Mensajes: 329
Antigüedad: 17 años, 8 meses
Puntos: 9
Respuesta: Adobe Dreamweaver "registro de Borrar"

lo que veo es que estas poniendo esto
Código PHP:
$deleteSQL sprintf("DELETE FROM  ``noticias-es``WHERE id=%s"
                       
GetSQLValueString($_POST['id'], "int")); 
esta parte estas poniendo doble ''

DELETE FROM ``noticias-es``

deberia de ser
Código PHP:
$deleteSQL sprintf("DELETE FROM noticias-es WHERE id=%s"
                       
GetSQLValueString($_POST['id'], "int")); 
  #4 (permalink)  
Antiguo 20/06/2011, 15:45
Avatar de camilo_1987  
Fecha de Ingreso: junio-2008
Ubicación: ALZIRA, Spain, Spain
Mensajes: 77
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: Adobe Dreamweaver "registro de Borrar"

problemas yo no puedo toca borrar, codigo es muy mal "Incorrect table name " "
  #5 (permalink)  
Antiguo 20/06/2011, 15:46
Avatar de jotaincubus  
Fecha de Ingreso: mayo-2005
Ubicación: Medellin - Colombia
Mensajes: 1.797
Antigüedad: 19 años
Puntos: 394
Respuesta: Adobe Dreamweaver "registro de Borrar"

Y esto creo que esta mal:

<a href="borrar.php?id=<?php echo $row_Recordset1['id']; ?>">

Esta colocando las etiquetas PHP dentro de dos comillas en el valor del href...
__________________
Por que existe gente que no agradece después de que se le ha brindado tiempo y ayuda ???
  #6 (permalink)  
Antiguo 20/06/2011, 15:47
Avatar de camilo_1987  
Fecha de Ingreso: junio-2008
Ubicación: ALZIRA, Spain, Spain
Mensajes: 77
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: Adobe Dreamweaver "registro de Borrar"

muchas gracias
  #7 (permalink)  
Antiguo 20/06/2011, 15:50
Avatar de bUllan9ebrio  
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 3 meses
Puntos: 128
Respuesta: Adobe Dreamweaver "registro de Borrar"

Estas seguro que es noticias-es el nombre de tu tabla?
"Incorrect table name " " si te arroja ese error creo que te equivocaste por esa parte


camilo_1987 please use google translator


yo no saber tu idioma, no entender tu gramatica
__________________
Si no vivimos como pensamos, pronto empezaremos a pensar como vivimos.
Más vale un Gracias sincero, que un número que aumente "popularidad" ¬¬°

Universidad de chile, campeón

Etiquetas: adobe, borrar, dreamweaver, registro
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 21:11.