Jump to content

Fog Juice

Members
  • Posts

    93
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Fog Juice's Achievements

Member

Member (2/5)

0

Reputation

  1. *update* basically I'm trying to do something like count all nicknames with a distinct ip address per nickname. So if a nickname has duplicate ip addresses, only the 1 ip address is counted.
  2. Thanks, however, I don't want it to show the total count, just the count of nickname per ip address. For example, the print out in my original post shows fogjuice three times, using group by will obviously group them all together and print a count of 3 but that is incorrect for what i'm trying to do. It should only count two because there are only two unique ip addresses, so the third entry shouldn't be counted because it is a duplicate nickname/ip. I don't think what i'm trying to do is as simple as a group by, I'm hoping it isn't too hard, I just dont know where to begin.
  3. thanks for trying, but nickname is already in the group by. I'm trying to get it so it excludes all duplicate ip/nickname's in the count(nickname). So basically, if there are two or more rows with the same nickname and ip address, only one is counted.
  4. What I'm trying to do is create a top list which will display the top 10 usernames by unique ip address. So basically, if an ip address is showing multiple times with the same nick name, then only one entry should be counted. This sql I'm using is below, but I'm unsure of how to filter it so it isn't showing every single time a nickname is entered by the same ip in the count. Only one nickname per IP should be counted in the sql statement below. SELECT nickname, count(nickname) nbr FROM `log` group by ip_addr, nickname order by nbr desc limit 10; id, nickname, ip_addr 1 fogjuice 2.2.2.210 2 fogjuice 2.2.2.210 3 fogjuice 21.6.3.210 4 bull 2.2.2.210 5 bull 29.20.13.2 6 bull 2.2.2.210 7 harvey 2.2.2.210 8 harvey 2.2.2.210 9 harvey 2.2.2.210 10 jane 2.2.2.210 11 tom 2.2.2.210
  5. Hmm it seems that either one doesn't work when trying to go directly to the url, it results in http://yourdomain.com/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php Basically, there won't by any directories. All I need is a .htaccess that changes any http://yourdomain.com/nameofwhatever to http://yourdomain.com/index.php/nameofwhatever.
  6. Hello, I have the following htaccess RedirectMatch 301 ^/.*$ http://mydomain.com/index.php What I would like to do is add it so the requested director would be added onto the http://mydomain.com/index.php. So for example, if someone were trying to access http://mydomain.com/folder then the .htaccess would redirect to http://mydomain.com/index.php/folder. I've been searching for hours on google but can't figure it out, does anyone have any tips? The .htaccess syntax is what confuses me. Thanks. *edit* I think I got it: RedirectMatch 301 (.*) http://mydomain.com/index.php$1
  7. What I don't understand though is why does pasting work in the first textbox, but not the second? They are both using the same functions, same key codes.
  8. I have the following code below which allows only alphanumeric characters for one text box, and then only numeric characters in the second. My problem is that in the first box, users can paste, which is perfectly fine, but in the second text box, they can't paste. I'd like it so that users could paste in each text box. Does anyone know why the second text box doesn't allow users to paste? It is quite odd to me and I'm not sure why. One other thing is that the first textbox allows the % sign, but as far as I can see, the regex I have is only for alphanumeric characters. <script> function alphanumericscan(e, call){ var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var character = String.fromCharCode(code); //alert(\'Character was \' + character); //alert(code); if (code == 8 || code == 9 || code == 37 || code == 39 ) return true; if(call == "alpha") var AllowRegex = /^[a-zA-Z0-9]+$/; else var AllowRegex = /^[0-9]+$/; if (AllowRegex.test(character)) return true; return false; } </script> Letters and numbers only: <input onkeypress="return alphanumericscan(event, 'alpha');" /><br /> Numbers only: <input onkeypress="return alphanumericscan(event, 'numonly');" />
  9. Thank you, and I apologize for not being more clear in my question. I've attached an image to make it easier to understand what I'm trying to do. It is easier to show you a diagram rather than give you a word problem. In the image you will see sets of blocks. So for example, there is 86400 seconds in a day and 5 blocks per day. That means each block is 17280 seconds. How can I determine how many seconds are left in each block before the next one is reached? 5 is just an arbitrary number, it could be 10, 50, 1023, or any number the user sets. There could be 1440 blocks a day (each block is 60 seconds), there could be 2000 (each block is 43.2 seconds). [attachment deleted by admin]
  10. Hello, what I'm trying to do is figure out a formula or equation that will help me to activate a script X amount of times a day where X is set by the user. My problem is discovering how many times left to activate the script it on the day they set X. For example, the user sets the script to activate 5 times day, or in other words, every 17280 seconds (since there are 86400 seconds in a day). Now, when activating it each day it is easy to keep track of because you can just calculate each block by 17280 seconds. My problem is how do I figure out how many times are left on the day the user sets the script. For example, if the user sets the script to activate 5 times a day and there is only half a day left, the script should only activate a few more times that day. Thanks!
  11. Hello, I want to make one mysql query but it will be connecting to two different databases on two different servers. Is this possible? Here is the query I have written, I'm just not sure how to get it to work with two db's. $sql = "SELECT cdb.ca.achievement, cdb.c.name, cdb.c.race, cdb.c.class, cdb.c.gender, cdb.c.level, vb.a.name FROM cdb.characters c, cdb.character_achievement ca, vb.achievements a WHERE cdb.c.guid = cdb.ca.guid AND cdb.ca.achievement = vb.a.id ORDER BY cdb.ca.date DESC LIMIT 100 ;"; Any help would be very much appreciated.
  12. Does anyone have an example of this? I'm quite lost tbh, I've searched all over the internet and feel like I understand the concept but just getting it into code is what I'm having trouble with.
  13. Does anyone know if it is possible for a minimax algorithm to be created in php? If you don't know what I'm talking about, please have a quick look here -> http://ai-depot.com/articles/minimax-explained/ . It is used to create a sort of search tree to determine the best course to win logic games. I'm trying to create tic tac toe and I have everything working other than a good AI, hoping I can use minimax with PHP. Right now my tic tac toe CPU moves are calculated randomly, as a consequence unfortunately it is easy beat the computer. Any suggestions would be helpful, if anyone has ever used something like this before in PHP I would appreciate it if you could share an example. Thanks.
  14. Hello, I keep getting the following error from this code but I can't figure out waht the problem is. Any suggestions? Error: [Err] 1005 - Can't create table 'dsds.mana_char_status_effects' (errno: 150) Code: -- -- table: `mana_char_status_effects` -- CREATE TABLE IF NOT EXISTS `mana_char_status_effects` ( `char_id` int(10) unsigned NOT NULL, `status_id` smallint(5) unsigned NOT NULL, `status_time` int(10) signed NOT NULL, -- PRIMARY KEY (`char_id`, `status_id`), FOREIGN KEY (`char_id`) REFERENCES `mana_characters` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
×
×
  • 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.