Jump to content

Mysql commands


damdempsel

Recommended Posts

On my site I made a script that will put someones IP address in my database every time they try to access the admin pages without the right permissions. I originally used the insert command but it ended up putting in the persons IP in a separate row each time they attempted. The way my table is set up is I have a column for their IP, and a column for the number of times they attempted. When they tried more then once, I would get the same IP more than once which I want to fix. I tried to use the update command but then it can't insert new IP's into the database. The column for how many times they attempt to access an admin page works fine, it's just the IP column. How would I fix this?

 

 

If you don't understand what I am talking about you can attempt at interpreting this (how I would like the tables to look):

 

This is NOT what I want.

IP                    | Times attempted

192.168.0.102|1

192.168.0.102|2

 

This is what I want.

IP                    | Times attempted

192.168.0.102|1

 

(Next attempt)

IP                    | Times attempted

192.168.0.102|2

Link to comment
https://forums.phpfreaks.com/topic/184721-mysql-commands/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.