damdempsel Posted December 11, 2009 Share Posted December 11, 2009 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 More sharing options...
trq Posted December 11, 2009 Share Posted December 11, 2009 See here. ps: This question also really belongs in mysql help. Link to comment https://forums.phpfreaks.com/topic/184721-mysql-commands/#findComment-975151 Share on other sites More sharing options...
damdempsel Posted December 11, 2009 Author Share Posted December 11, 2009 Thank you! Sorry for putting it in the wrong section, I was feeling a little lazy and didn't want to look for the other one. Link to comment https://forums.phpfreaks.com/topic/184721-mysql-commands/#findComment-975160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.