Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/04/2016, 23:27
wilson_romero
 
Fecha de Ingreso: diciembre-2015
Mensajes: 369
Antigüedad: 8 años, 4 meses
Puntos: 4
Problema con una sistexis creando base de datos

Hola miago estoy tratando de aprende como hacer un sistema de noticias pero en el primer paso trato de crear la base de datos y me da un error no se mucho de mysql

este es el problema
Código MySQL:
Ver original
  1. Error
  2. Static analysis:
  3.  
  4. 2 errors were found during analysis.
  5.  
  6. Unexpected beginning of statement. (near "`p`" at position 316)
  7. Unrecognized statement type. (near "varchar" at position 320)
  8. SQL query:
  9.  
  10. CREATE TABLE IF NOT EXISTS `comentarios` ( `Id` mediumint(9) NOT NULL AUTO_INCREMENT, `Id_Comentarios` varchar(40) NOT NULL, `Autor` text NOT NULL, `Comentario` text NOT NULL, `Fecha` varchar(40) NOT NULL, `Ip` varchar(40) NOT NULL, PRIMARY KEY (`Id`) ) CREATE TABLE IF NOT EXISTS `ip` ( `p` varchar(40) NOT NULL DEFAULT '', PRIMARY KEY (`Ip`) ) CREATE TABLE IF NOT EXISTS `noticias` ( `Id` mediumint(9) NOT NULL AUTO_INCREMENT, `Titulo` text NOT NULL, `Contenido` text NOT NULL, `Categoria` varchar(40) NOT NULL, `Fecha` varchar(40) NOT NULL, `Ip` varchar(40) NOT NULL, PRIMARY KEY (`Id`) )
  11.  
  12. MySQL said: Documentation
  13.  
  14. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS `ip` (
  15. `p` varchar(40) NOT NULL DEFAULT '',
  16.   PRIM' at line 11

este es el código mysql

Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `comentarios` (
  2.   `Id_Comentarios` varchar(40) NOT NULL,
  3.   `Autor` text NOT NULL,
  4.   `Comentario` text NOT NULL,
  5.   `Fecha` varchar(40) NOT NULL,
  6.   `Ip` varchar(40) NOT NULL,
  7.   PRIMARY KEY (`Id`)
  8. )
  9.  
  10. CREATE TABLE IF NOT EXISTS `ip` (
  11.  `p` varchar(40) NOT NULL DEFAULT '',
  12.   PRIMARY KEY (`Ip`)
  13. )
  14.  
  15. CREATE TABLE IF NOT EXISTS `noticias` (
  16.   `Titulo` text NOT NULL,
  17.   `Contenido` text NOT NULL,
  18.   `Categoria` varchar(40) NOT NULL,
  19.   `Fecha` varchar(40) NOT NULL,
  20.   `Ip` varchar(40) NOT NULL,
  21.   PRIMARY KEY (`Id`)
  22. )