Foros del Web » Programando para Internet » PHP »

Por ke me marca error al subir este codigo ala BD

Estas en el tema de Por ke me marca error al subir este codigo ala BD en el foro de PHP en Foros del Web. Hola amigos miren, tengo mi web en nuke y resulta ke hice un respaldo y borre la base de datos de mi nuke (esto lo ...
  #1 (permalink)  
Antiguo 15/06/2005, 19:13
Avatar de ~°The-Herps°~
Usuario baneado!
 
Fecha de Ingreso: septiembre-2004
Ubicación: M E X I C O
Mensajes: 498
Antigüedad: 19 años, 7 meses
Puntos: 0
Por ke me marca error al subir este codigo ala BD

Hola amigos
miren, tengo mi web en nuke
y resulta ke hice un respaldo y borre la base de datos de mi nuke (esto lo e hecho varias veces)
resulta, ke hace poco instale una galeria coppermine
ahora ke hice el respaldo y borre me marca un error:


MySQL said:

#1170 - BLOB column 'caption' used in key specification without a key length


Este es el codigo (donde marca el error)
Código PHP:
# --------------------------------------------------------
#
# Table structure for table 'cpg_pictures'
#

CREATE TABLE cpg_pictures (
   
pid int(11NOT NULL auto_increment,
   
aid int(11) DEFAULT '0' NOT NULL,
   
filepath varchar(255NOT NULL,
   
filename varchar(255NOT NULL,
   
filesize int(11) DEFAULT '0' NOT NULL,
   
total_filesize int(11) DEFAULT '0' NOT NULL,
   
pwidth smallint(6) DEFAULT '0' NOT NULL,
   
pheight smallint(6) DEFAULT '0' NOT NULL,
   
hits int(10) DEFAULT '0' NOT NULL,
   
mtime timestamp(14),
   
ctime int(11) DEFAULT '0' NOT NULL,
   
owner_id int(11) DEFAULT '0' NOT NULL,
   
owner_name varchar(40NOT NULL,
   
pic_rating int(11) DEFAULT '0' NOT NULL,
   
votes int(11) DEFAULT '0' NOT NULL,
   
title varchar(255NOT NULL,
   [
B]caption text NOT NULL,[/B]
   
keywords varchar(255NOT NULL,
   
approved enum('YES','NO') DEFAULT 'NO' NOT NULL,
   
user1 varchar(255NOT NULL,
   
user2 varchar(255NOT NULL,
   
user3 varchar(255NOT NULL,
   
user4 varchar(255NOT NULL,
   
url_prefix tinyint(4) DEFAULT '0' NOT NULL,
   
randpos int(11) DEFAULT '0' NOT NULL,
   
PRIMARY KEY (pid),
   
KEY pic_hits (hits),
   
KEY pic_rate (pic_rating),
   
KEY aid_approved (aidapproved),
   
KEY randpos (randpos),
   
KEY pic_aid (aid),
   
KEY search (titlecaptionkeywordsfilename)
); 
lo modifico y le pongo (255) como en los demas y marca error de syntaxis
por ke no lo sube??
Saludos
  #2 (permalink)  
Antiguo 16/06/2005, 00:03
 
Fecha de Ingreso: junio-2005
Mensajes: 15
Antigüedad: 18 años, 10 meses
Puntos: 0
deberas de cambiar la ultima linea:
KEY search (title, caption(255), keywords, filename)

en el tutorial de mysql dice:
The MyISAM and (as of MySQL 4.0.14) InnoDB storage engines also support indexing on BLOB and TEXT columns. When indexing a BLOB or TEXT column, you must specify a prefix length for the index. For example:
CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));
completo en: http://dev.mysql.com/doc/mysql/en/create-table.html

ya que lo arregles te marcara el siguiente error:
1071 : Specified key was too long. Max key length is 500
y ahi, bueno, hasta ahi llego, suerte.
  #3 (permalink)  
Antiguo 16/06/2005, 12:57
Avatar de ~°The-Herps°~
Usuario baneado!
 
Fecha de Ingreso: septiembre-2004
Ubicación: M E X I C O
Mensajes: 498
Antigüedad: 19 años, 7 meses
Puntos: 0
jejej
bueno ya agregue otra base
Saludos
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 19:25.