Perdonad de nuevo, pero me urge solucionar este error, ue no se porque me sale.
Cita:
Modificar Noticia
Warning: mysql_query() [http://www.mysql.com/doc]: 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 '' at line 1 in /home/ggroup/public_html/noticias/noticiamver.php on line 66
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/ggroup/public_html/noticias/noticiamver.php on line 67
Os indico el código de la página ... (los datos estan bien configurados, en cuanto a usuario, clave ..)Modificar Noticia
Warning: mysql_query() [http://www.mysql.com/doc]: 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 '' at line 1 in /home/ggroup/public_html/noticias/noticiamver.php on line 66
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/ggroup/public_html/noticias/noticiamver.php on line 67
Código HTML:
<?php include ('seguridad.php');?> <!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>ggroup .-</title> <link href="../css/Estilo.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <script> function envia(pag){ document.editanoticia.action = pag document.editanoticia.submit() } </script> </head> <body> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="150"><a href="../index.php" target="_self"><img src="../imagenes/logoggroup.gif" width="150" height="87" border="0" /></a></td> <td width="640" align="right" valign="top" background="../imagenes/fondosuperior.jpg"><div align="left"></div></td> </tr> </table></td></tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td width="125" class="TablaContenedorMenu"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td> </td></tr> <tr> <td><a href="noticias.php" target="_self" class="menun">Zona Noticias</a></td> </tr> <tr> <td>Nueva<br /></td> </tr> <tr> <td><br /></td> </tr> <tr> <td><a href="salir.php" target="_self" class="menun">Salir</a></td> </tr> <tr> <td><br /></td> </tr> </table></td> <td width="20" class="TablaSeparacion"><br /></td> <td class="TablaContenidoCenteral"><br /> <p>Modificar Noticia<br /> <?php ////////////////////////////////////////// // CONEXION CON LA BASE DE DATOS // // sustituir por un a funcion // $link = mysql_connect('localhost', 'ggroup', 'casiopea') or die('Error conectando con el servidor.'); $db = mysql_select_db('ggroup_noticias', $link) or die ('No se puede conectar con la base de datos.'); ////////////////////////////////////////// $q = 'select * from noticias where NoticiaID= ' . $noticiaid; $result=mysql_query($q,$link); $reg = mysql_fetch_row($result); ?> </p> <form name="editanoticia" action='noticiaprocm.php' method='post' id="editanoticia"> <table> <tr> <td>Orden:</td> <td><input type="text" name="orden" size="20" maxlength="30" id="orden" value="<?php echo $reg[1];?>"/></td> </tr> <tr> <td>Titulo:</td> <td><input type="text" name="titulo" size="20" maxlength="50" id="titulo" value="<? echo $reg[2];?>"/></td> </tr> <tr> <td width="120" valign="top">Contenido:</td> <td><textarea name="contenido" cols="50" rows="10" id="contenido"><?php echo $reg[3];?> </textarea></td> </tr> </table> <input type="hidden" name='nid' id='nid' value="<?php echo $reg[0];?>" /> <div align="right"> <input name="bCancelar" type="button" id="bCancelar" onclick="javascript:history.back();" value="Cancelar"/> <input name="bBorrador" type="button" id="bBorrador" onclick="envia('noticiaprocm.php');" value="Guardar"/> <?php if($reg[0] == 1){ echo "<input name=\"bEliminar\" type=\"button\" id=\"bEliminar\" onclick=\"envia('noticiaprocb.php');\" value=\"Eliminar2\"/>"; }?> <input name="bEliminar" type="button" id="bEliminar" onclick="envia('noticiaprocb.php');" value="Eliminar"/> </div> <div align="left"><strong>Ayuda sobre contenidos.</strong><br /> - Puede usar código HTML dentro de los campos Título y Contenido.<br /> Por ejemplo: Si desea resaltar la palabra “ggroup”, podría conseguirlo mediante la inclusión del código (eliminar espacios en blanco) <em>< span class="ggroupNoticias">GGroup< /span> </em><br /> - El campo orden determina la posición que ocupará en el conjunto de las Noticias. Los valores 1, 2 y 3 están reservados a las tres columnas iniciales, de izquierda a derecha, respectivamente. Estos contenidos (1,2 y 3), sólo podrán editarse, nunca ser eliminados). </div> </div> </form></td> </tr> </table><bR /><BR /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="TablaCopyRightNoticias"><a href="noticias/indexnoticias.php" target="_top" class="enlacenoticias">G.Group</a>. Pol. Industrial El Trocadero. Telf.:856 21 02 85. Fax:856 21 30 50</td> </tr> </table> </td> </tr> </table> </td> </tr> <tr></tr> </table> </body> </html>
Código PHP:
<?php
//Inicio la sesión
session_start();
//COMPRUEBA QUE EL USUARIO ESTA AUTENTIFICADO
if ($_SESSION['autentificado'] != 'SI') {
//si no existe, envio a la página de autentificacion
header('Location: indexnoticias.php');
//ademas salgo de este script
exit();
}
?>
Gracias