Foros del Web » Programando para Internet » PHP »

Error MySQL ¿?¿?

Estas en el tema de Error MySQL ¿?¿? en el foro de PHP en Foros del Web. Disculpen que joda, pero tengo un error que no entiendo y no se como solucionarlo :S Es este: Error: You have an error in your ...
  #1 (permalink)  
Antiguo 27/09/2007, 20:17
 
Fecha de Ingreso: diciembre-2006
Mensajes: 294
Antigüedad: 17 años, 4 meses
Puntos: 2
Error MySQL ¿?¿?

Disculpen que joda, pero tengo un error que no entiendo y no se como solucionarlo :S

Es este:

Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '<u>b>>'>'> a<<u>>t'>start='fals'>' w'>'>th='400' h'>'>g

Desde ya gracias.
  #2 (permalink)  
Antiguo 28/09/2007, 01:13
Avatar de kaninox  
Fecha de Ingreso: septiembre-2005
Ubicación: In my House
Mensajes: 3.597
Antigüedad: 18 años, 7 meses
Puntos: 49
Re: Error MySQL ¿?¿?

pues parece error de codigo html en php, pos no seria mejor que mostraras el codigo :/ de donde pasa eso
__________________
Gokuh Salvo al mundo. PUNTO!!!!
  #3 (permalink)  
Antiguo 28/09/2007, 12:46
 
Fecha de Ingreso: diciembre-2006
Mensajes: 294
Antigüedad: 17 años, 4 meses
Puntos: 2
Re: Error MySQL ¿?¿?

Hola ;) che estos son los 2 archivos para lograr que se envie la noticia:

noticias_ingresar.php
Código PHP:
<?
session_start
();
if(!isset(
$SESSION)){
header("location:index.php");
} else {
include(
"config.php");
include(
"../header.php");
include(
"../meta.php");
?>
<table width="700" align="center">
<tr>
<td width="1%" valign="top">
<?php include("../menu.php"); ?>
</td>
<td width="99%" valign="top">
<?
echo '<h1 class="titulo">Panel de Administración</h1>
<form method="post" action="proc.php?que=noticias_ingresar">
<table border="0" cellpadding="2" cellspacing="1" align="center">
 <tr> 
  <td>Titulo:</td>
  <td width="85%"><input type="text" name="titulo" width="450"></td>
 </tr>
 <tr>
  <td valign="top" width="14%">Noticia Corta:</td>
  <td width="85%"><textarea name="noticiacorta" cols="9" rows="9"></textarea></td>
 </tr>
 <tr>
  <td valign="top" width="14%">Noticia Larga:</td>
  <td width="85%"><textarea name="noticialarga" cols="9" rows="9"></textarea></td>
 </tr>
 <tr> 
<td>Imagen:</td>
<td width="85%">
<select name="imagen">'
;
$directorio opendir("../imagenes_publicaciones/");
while (
$imagen readdir($directorio))
{
    if (
$imagen != '.' && $imagen != '..' && strpos($imagen'.php') === false)
    {
        echo 
'<option value="' $imagen '">' $imagen '</option>';
    }    
}
closedir($directorio);
echo 
'
</select><a href="admin_imagenes_publicaciones_ver.php" target="_blank">VER IMAGENES</a>
</td></tr>
 <tr>
  <td>&nbsp;</td>
  <td><input type="submit" name="enviar" value="Enviar"></td>
 </tr>
</table>
</form>'
;
?>
</td>
</tr>
</table>
<?php 
include("../derechos.php"); 
echo(
"</body></html>");
}
?>
proc.php
Código PHP:
<?
session_start
();
if(!isset(
$SESSION)){
header("location:index.php");
} else {
include(
"../config.php");
include(
"../header.php");
include(
"../meta.php");
?>
<table width="700" align="center">
<tr>
<td width="1%" valign="top">
<?php include("../menu.php"); ?>
</td>
<td width="99%" valign="top">
<?
echo"<H1 class=titulo>Panel de Administración</H1>";

$dia date ("d");
$mes date ("m");
$ano date ("Y");
$mostrar $dia "/" $mes "/" $ano;

$hora date ("g");
$minutos date ("i");
$tipo date ("a");
$mostrar2 $hora ":" $minutos "  " $tipo;

switch(
$que){
// INGRESAR
case 'noticias_ingresar':
$fecha $mostrar;
$horario $mostrar2;
$categoria "Información";
$titulo quitar($_POST[titulo]);
$noticiacorta quitar($_POST[noticiacorta]);
$noticialarga quitar($_POST[noticialarga]);
$imagen quitar($_POST[imagen]);

if(!
$titulo || !$noticiacorta || !$noticialarga || !$categoria || !$imagen){
echo
"Faltó completar un campo obligatorio <br>
<a href=\"noticias_ingresar.php\">Volver atras</a>"
;
} else {

$sql "INSERT INTO noticias(categoria, fecha, horario, titulo, noticiacorta, noticialarga, imagen, activo) values('$categoria', '$fecha', '$horario', '$titulo', '$noticiacorta', '$noticialarga', '$imagen', '1')";
$res mysql_query($sql) or die("Error: ".mysql_error());

echo
"Noticia Ingresada con éxito <br>
<a href=\"index.php\">Volver al index</a>"
;
}
break;

// MODIFICAR
$titulo quitar($_POST[titulo]);
$noticiacorta quitar($_POST[noticiacorta]);
$noticialarga quitar($_POST[noticialarga]);
$imagen quitar($_POST[imagen]);

if(!
$titulo || !$noticiacorta || !$noticialarga || !$imagen){
echo
"Faltó completar un campo obligatorio <br>
<a href=\"informacion_modificar.php\">Volver atras</a>"
;
} else {

$sql "UPDATE noticias set titulo='$titulo', noticiacorta='$noticiacorta', noticialarga='$noticialarga', imagen='$imagen' WHERE id='$_POST[id]'";
$res mysql_query($sql) or die("Error: ".mysql_error());

echo
"Noticia Editada con éxito <br>
<a href=\"index.php\">Volver al panel de administración</a>"
;
}
break;

// ELIMINAR
case 'noticias_eliminar':
$res mysql_query("delete from informacion where id='$_POST[borrar]'") or die("Error: ".mysql_error());

echo
"Noticia Borrada con éxito <br>
<a href=\"index.php\">Volver al panel de administración</a>"
;

break;
}
?>
</td>
</tr>
</table>
<?php 
include("../derechos.php"); 
echo(
"</body></html>");
}
?>
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 08:25.