Re: multiple fields all unique?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John W. Holmes wrote:
From: "Jason Gerfen" <jason.gerfen@xxxxxxxxxxxx>

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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux