<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Timothy,<br>
<br>
If you are wanting to place a limit on the text column, try VARCHAR and
limit that.<br>
<br>
This means that your sql script would look like<br>
<br>
CREATE TABLE library (
<br>
ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
<br>
Filename TEXT NOT NULL,
<br>
Artist TEXT NULL,
<br>
Title TEXT NULL,
<br>
Album TEXT NULL,
<br>
FID <font color="#3366ff">VARCHAR</font>(40) NOT NULL,
<br>
PRIMARY KEY ID (ID),
<br>
INDEX UID (FID)
<br>
) TYPE = MyISAM COMMENT ='';
<br>
<br>
And quickly testing it seems to work<br>
<br>
Hope that it helps<br>
<br>
Cheers<br>
Mike Fewings<br>
<br>
Timothy White wrote:
<blockquote cite="mid42195881.6070508@tigris.org" type="cite">I know
this isn't PHP but hopefully one of you guys will know the answer (and
it is for a PHP project)
<br>
I am trying to create a table that has a primary key and a unique key
based on different columns.
<br>
The query is:
<br>
CREATE TABLE library (
<br>
ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
<br>
Filename TEXT NOT NULL,
<br>
Artist TEXT NULL,
<br>
Title TEXT NULL,
<br>
Album TEXT NULL,
<br>
FID TEXT(40) NOT NULL,
<br>
PRIMARY KEY ID (ID),
<br>
INDEX UID (FID)
<br>
) TYPE = MyISAM COMMENT ='';
<br>
And the error is:
<br>
ERROR 1170 (42000): BLOB/TEXT column 'FID' used in key specification
without a key length
<br>
I can't find anything in the manual that tells me how to get around
this.
<br>
<br>
Thanks
<br>
<br>
Tim
<br>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">
NOTE: This email contains information which may be confidential or privileged. Its contents remain the property of Mr Michael Fewings. The information is intended solely for the use of the recipient (or legal entity) named above. If you are not the intended recipient and/or purport to be the intended recipient you must not read, use or disseminate the enclosed information. The content and email itself are subject to intellectual property rights and copyrights. If you have received this electronic transmission in error, please notify Mr Michael Fewings by electronic mail immediately. Any opinions expressed are those of the author, not those of any other party. This email does not constitute either offer or acceptance of any contractually binding agreement. Such offer or acceptance must be communicated in writing through other channels.
</pre>
</body>
</html>