db php question
| From: | redhat | Date: | Thu, 15 Jan 2004 19:09:25 +0000 |
| Subject: | db php question | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32420@lists.php.net to get a copy of this message | ||
I have a very crude script set up that I am using to keep track of IP
addresses, MAC addresses, etc and it dumps into mysql. I am using a
column called "id" which is my primary key and auto-increments. My
question is that I want to make sure that I don't get duplicate IP
addresses added into the database and right now it is a varchar field
and anything can be put in there. If I change the column and make it my
primary key will that prohibit duplicate entries? Is there a better way
to do this? I am not a programmer either so I am having to hack my way
through this. The second thing that I wanted to do was to be able to
run a simple web form search for either ip addresses or computer name
and return results. From what I have seen this seems pretty complex -
any thoughts?
thanks,
DF