Re: db php question

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

 



Hello,

Thursday, January 15, 2004, 7:09:25 PM, you wrote:

r> I have a very crude script set up that I am using to keep track of IP
r> addresses, MAC addresses, etc and it dumps into mysql.  I am using a
r> column called "id" which is my primary key and auto-increments.  My
r> question is that I want to make sure that I don't get duplicate IP
r> addresses added into the database and right now it is a varchar field
r> and anything can be put in there.  If I change the column and make it my
r> primary key will that prohibit duplicate entries?  Is there a better way
r> to do this?  I am not a programmer either so I am having to hack my way

Set the IP column type to be Unique. It doesn't have to be a Primary
Key just to be unique.

r> through this.  The second thing that I wanted to do was to be able to
r> run a simple web form search for either ip addresses or computer name
r> and return results.  From what I have seen this seems pretty complex -

Actually, it's pretty simple. If you can post your SQL table structure
here someone could show you how to write a PHP script to display that
information pretty quickly I would have thought.

-- 
Best regards,
 Richard                            mailto:rich@xxxxxxxxxxxxxxxx

-- 
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