Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/09/2010, 11:16
mamonga
 
Fecha de Ingreso: abril-2010
Mensajes: 86
Antigüedad: 14 años
Puntos: 0
Respuesta: Tengo un problema....

Buenas, he escrito lo que me has dicho y ahora con el or die me reporta el fallo que tenia, me dice: 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 'in, out, ratio) values ('gg','www', 0, 0, 0, 1, 0)' at line 1


El archivo guardar.php me ha quedado asi:
Código PHP:
<?
  
include"conexion.php";
  
$in24=0;   //Inicializo los valores de in, out y ratio, ya que no son campos rellenables por el usuario
  
$out24=0;
  
$in=0;
  
$out=1;
  
$ratio=0;
  
$dominio=$_POST['dominio'];
  
$nombre=$_POST['nombre'];
  
$insertar="INSERT INTO webs (dominio, nombre, in24, out24, in, out, ratio) values ('$dominio','$nombre', $in24, $out24, $in, $out, $ratio)";    
  
mysql_query($insertar) or die (mysql_error());
  echo
" <html>
    <head></head>
    <body>
    <h3>Los datos han sido guardados</h3>
    </body>
    </html>"
;
include 
"cerrar_conexion.php";
?>
Lo de error en line 1 no lo entiendo, si el error esta en la linea 1 porque pone que el error esta cerca de ....(for the right syntax to use near 'in, out, ratio) values ('gg','www', 0, 0, 0, 1, 0)' at line 1)

Saludos, y muchas gracias!!