FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


sql with phpmyadmin





traxion
im making my first sql database with phpmyadmin

im just starting to make a tabel with nickname , voornaam and achternaam.
i want to make nickname a uniek but it gives a error

Code:
 SQL-query: Wijzigen

ALTER TABLE `members` ADD UNIQUE (
`nickname`
);


and
Code:
 MySQL retourneerde: Documentatie
#1170 - BLOB column 'nickname' used in key specification without a key length


i tryed to add a key length but it doesnt work

does anybody now how i can do that?
------------------------------------------------------------

i got it already working
u must make a max length. then u can make it uniek
holadola
This is the syntax from the mysql documentation:

Code:
ADD [CONSTRAINT [symbol]]
        UNIQUE [INDEX] [index_name] [index_type] (index_col_name,...)


I don't think You should give the column name as a string, try:

Code:
ALTER TABLE `members` ADD UNIQUE (
nickname
);


/hd
Related topics
Help: SQL error after uploading new files(thread updated)
SLOW UPLOADING AN SQL FILE
I can't upload my Database SQL script ! Helllppppp!!!!
Sql Error: 1017. Missing all the indexes files of phpbb
[man]Servidor Web Personal (Tutorial)
How to edit SQL files?
MySql to SQL
.sql problem
Importing/executing a BIG .SQL File
phpmyadmin
importing SQL databases
Sql/Phpbb error...
Error on running a Big SQL Statement on MySql
Issue uploading SQL database.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.