Re: multiple fields all unique?
| From: | Jas | Date: | Tue, 03 Feb 2004 21:29:32 +0000 |
| Subject: | Re: multiple fields all unique? | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32774@lists.php.net to get a copy of this message | ||
John W. Holmes wrote:
From: "Jason Gerfen" <jason.gerfen@scl.utah.edu>+----------+--------------+------+-----+---------+----------------+Yeah, I have never used a unique field for the database, and you are right it is a mysql db.Now is a good time to do it the right way, then... ---John Holmes... Yes definately, I am trying to convert my exisiting fields to a unique type and am having no luck what-so-ever. This is the table format:
| Field | Type | Null | Key | Default | Extra |+----------+--------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment | | hostname | varchar(100) | | | | | | mac | varchar(100) | | | | | | ip | varchar(100) | | | | | | vlan | varchar(100) | | | | |+----------+--------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec) and this is the command I am tying to run to modify the hostname, mac & ip fields to unique. alter hosts add unique mac; etc. I have such a hard time with mysql's manual. Jas