Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. That will pull out all records with a better score than me, but it does not return my own score which I need it to Can you expand? I tried this SELECT count(*), (SELECT minutes_online_month FROM cache WHERE username = 'jaymc') as score FROM cache WHERE minutes_online_month > score But it doesnt like the > score part and I dont want to have 3 queries in one..
  2. I have a table which contains 2 fields, username & score I want to find my score and the amount of people that have a better score than me, which will essentually tell me where I am ranked Can this be done in one query?
  3. Can anyone think of a solution to my problem
  4. BBParse::maxsize($data['1'], '$1') How can I get maxsize to see what $1 is then? Can anyone provide a different way to go about this?
  5. Hmm, preg_replace returns it as $1 by default, how can I get around that?
  6. I have this class class BBParse { public static function maxsize($call, $size) { echo $size; if ($call == "size" && $size > "4") {$size = "4";} return $size; } } And this preg_replace $string = preg_replace('/\['.$tag.'=(.+?)\](.+?)\[\/'.$tag.'\]/is','<'.$data[0].' '.$data[1].'='.BBParse::maxsize($data['1'], '$1').'>$2</'.$data[0].'>',$string); This part of the preg_replace is the issue BBParse::maxsize($data['1'], '$1') As you can see I am trying to manipulate the value of $data['1'] and $1. The $data['1'] is seen by maxsize() no problem, but $1 is seen by maxsize() as $1, as in that is the value when in actual fact the value of $1 is always 1,2,3 or 4 Its doing that because I have it wrapped in appostrophies '$1' so it sees it as a string, but if I take them off, the script dies Any ideas?
  7. jaymc

    Age based query

    Can you give an example of what you mean fenway?
  8. jaymc

    Age based query

    lets say I have these ages 14,15,15,16,17,20,23,25,25,26,29,30 I want to display them something like this 23,17,30,16,26,25,25,20,15,14,15 In other words, any age under 16 can never come before an age 16 or over I cant do a subquery because im not displaying all the results in one big list, they will be paginated
  9. jaymc

    Age based query

    No, as I dont want it to show oldest first, needs to be pretty random rather than display 30 year olds on the first 4 pages when its an 18 year old viewing
  10. jaymc

    Age based query

    I am not displaying them in 1 big list, there will be 20 per page and 50 pages, thats why its a bit tricky Any more ideas?
  11. I have a member database, and with that I have a members online list, heres the problem If a member is over 18, I want to display members over 16 first, then when there are no more over 16's, show anyone else (14, 15 year olds etc) So in other words there may be 23 pages of over 16's, then the 24th page will show 14 and 15 year olds How can I make this into a query, as obvious "select * from members where age >= 16" will not show any under 16s on page 24.. Any ideas?
  12. Oops sorry! I meant DDR1 PC2700, the mega hurts for that is actually 333Mhz I cant swap the disks, the other server cant take them, they are 1U servers, custom design, no can do So yeh its DDR1 333Mhz vrs DDR2 667Mhz Just need to know whether in practice, will there be noticable different due to memory frequency..
  13. I have 2 servers here, each I am debating which to use as my mysql server Both have 16GB of ram, however the specs of the ram are Server1: DDR2 667Mhz Server2 DDR1 2700Mhz The disks in Server2 are much better, but the ram is not as good. To avoid spending out on new SAS drives for server1, I was going to just use Server2 hoping the memory bus speed isnt going to give me any problems In summary, is bus speed a vital factor?
  14. jaymc

    Best disks

    Can anyone spot any obvious flaws with this drive that could degrade performance as a RAID 5 mysql setup http://discountechnology.com/Seagate-ST336754SS-SAS-Hard-Drive
  15. jaymc

    Best disks

    Im just wondering how far I need to go with this My MYSQL server will have 16GB of RAM so hopefully will not rely to much on disk However.. I dont ever want to get to the point where I am having performance issues because I went for the cheaper 10k as apposed to sas 15k
  16. jaymc

    Best disks

    Yeh, I was thinking about SATA too, but you cant get SATA 15k RPM? Surely SAS 15k will out perform SATA 10k? Am I correct.
  17. jaymc

    Best disks

    I am using a dedicated storage server to host mysql database, im just wondering, what type of disks would you reccomend and what raid I was thinking RAID 5, 3x SATA I know there are SAS, SCSI available What are your thoughts, I want the best performance possible Cheers.
  18. jaymc

    Disk access

    Has anyone ever had an issue with this type of setup?
  19. jaymc

    Disk access

    I have a server here with loads of memory, but not fast disk support My question is, would I notice a performance drop if I buy another server used soley for fast MYSQL Database storage, e.g RAID 5 15K SAS So basically one server to deal with processing and memory etc, and another which that server will use for storing database.. The network will be local of course Is this a bad idea? Any input?
  20. PHP does it like this function myFunction($mandatory_argument,$optional_argument = 1) { /* ...Whatever... */ }
  21. Lets say I have a function set out like this function beans($a,$b) { // DO STUFF } I have used this 100's of times in various scripts.. however, I now need to change this function to look like function beans($a,$b,$c) { // DO STUFF } Is there a way to call the function like beans($a,$b) or beans($a,$b,$c) so that if $c is not used it is simple ignored, as apposed to javascript giving an error I do not want to change all occurances of this function if I do not have to Thank you!
  22. http://www.site.com/?name=fred%26cheese echos fred&cheese RewriteRule ^name/(.+)?$ ?name=$1 [L] echos fred The problem is the rewrite rule seems to be encoding %26 back to & therefor ends up as http://www.site.com/?name=fred&cheese which breaks the name param in half Any ideas how to get around this? I cant use a diff character or filter it out, I need a solution that allows me to stop modrewrite from doing this Cheers
  23. Cheers
  24. Ok I see the problem. Without array_map("strip_tags", $_POST); everything is fine and this is the print_r of $POST Array ( [x] => 2 [y] => 3 [list] => Array ( [0] => 23913081 [1] => 23912398 ) ) With array_map("strip_tags", $_POST); here is the print_r of $_POST Array ( [x] => 2 [y] => 3 [list] => Array ) The issue is secondary arrays within a primary array
  25. $_POST = array_map("strip_tags", $_POST); $beans = join($_POST); join wont work on $_POST after array_map Note: reset($_POST); did not work
×
×
  • 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.