Jump to content
#FlattenTheCurve ×


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About loki951510

  • Rank

Profile Information

  • Gender
    Not Telling
  1. after looking though it all agen this moring i can see where i was gong wrong master=values(master) + 1, count=values(count) + 1 should of been just master = master + 1, count = count + 1 its because it was pulling the values from the insert vaules and not the databse its self
  2. the goal is that when an IP is banned from one of my servers the IP is sent to the database if the IP has never been banned it will make a new entry to the database (as far as i can tell this part is working) but if it is already in there it will add +1 to the IP entry what is already in there and add +1 to the count row as well (the part of the script i think is going wrong) it's so i can see if there is any IP's what are getting banned more then others so i can permanently ban them if needed see attached pic as you can see with IP (second on the list) MsT has been hit 2 times (but in my logs the IP has been banned 5 times but only showing 2) and VmH has been hit 1 time so the counts isnt going up over 2 where is should be 6
  3. Server version: 5.5.5-10.1.26-MariaDB "INSERT INTO iplist (ip, master, count) VALUES ('$ipget', '1', '1') ON DUPLICATE KEY UPDATE master=values(master) + 1, count=values(count) + 1"; CREATE TABLE IF NOT EXISTS `iplist` ( `id` int(255) NOT NULL AUTO_INCREMENT, `ip` varchar(255) NOT NULL, `master` varchar(255) NOT NULL DEFAULT '0', `vamps` varchar(255) NOT NULL DEFAULT '0', `curzed` varchar(255) NOT NULL DEFAULT '0', `count` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `ip` (`ip`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; When posting the IP to the server if its not in the database it will get a new entry or if the IP is already in the database it will add +1 onto the master table and add +1 to the count but the the min if its already in the database it is putting 2 onto the master row and 2 into the count row and then if it goes a 3ed time it just stays on 2 what i would like it to do is to add +1 each extra time its added into the database
  4. hi sorry that is almost right but i need cn1='blue' then then on the next click it would then be cn2='blue' ect
  5. yes thats how i need to do it if poss i want to set pad_count to '15' and cn1 to 'cn15'
  6. If i have both set like this they work $sql = "UPDATE users SET pad_count = (pad_count + $add_pad_count) WHERE username = '$session->username'"; $sql = "UPDATE users SET cn1='blue' WHERE username = '$session->username'"; but on the second UPDATE i need cn1 to be like cn$pad_count so it will turn the next block blue in the list how can i do this as its starting to drive me made i have been trying for about a week now to get this sorted thanks for the help in advance
  7. Ch0cu3r yes that worked is their w way to echo out what it was before and after anyway like that?
  8. i have this sql stament and i cant get it to work $sql2 = "SELECT pad_count FROM user WHERE pad_id = 1"; $sql = "UPDATE user ". "SET pad_count = ($sql2 + $pad_count) ". "WHERE pad_id = $pad_id" ; this is the error im getting from it can some one help me plz Could not update data: You can't specify target table 'user' for update in FROM clause
  • 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.