Toxicterror's Profile User Rating: -----

Reputation: 15 Tradesman
Group:
Active Members
Active Posts:
685 (0.45 per day)
Joined:
10-March 09
Profile Views:
4,984
Last Active:
User is offline Sep 04 2012 08:13 AM
Currently:
Offline

Previous Fields

Country:
CH
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   Toxicterror has not set their status

Posts I've Made

  1. In Topic: dont understand array_multisort

    Posted 4 Sep 2012

    didnt know that :D

    just solved the problem a minute ago :)

    while ($ds = mysql_fetch_object($rs)) {
        $userlist[] = array(
            $ds->user,
            $ds->coord,
            $ds->points,
            $ds->score,
            $ds->old_score-$ds->score,
            $ds->points-$ds->old_points,
            ($ds->points*100)/$ds->old_points-100
        );
    }
    
    function srt($a,$B)/> {
        return strnatcmp($a[6], $b[6]);
    }
    
    usort($userlist, 'srt');
    $userlist = array_reverse($userlist);
    


    this outputs a list which is sorted by the last entry (index 6)
  2. In Topic: dont understand array_multisort

    Posted 4 Sep 2012

    thanks alot... this last post was very helpful :)
    didnt have much time the last few weeks but i finally can solve this bug.

    how do you mean, you can accomplish this within a sql query?


    got the data like this now....
    while ($ds = mysql_fetch_object($rs)) {
        $userlist[] = array(
            $ds->user,
            $ds->coord,
            $ds->points,
            $ds->score,
            $ds->old_score-$ds->score,
            $ds->points-$ds->old_points,
            ($ds->points*100)/$ds->old_points-100
        );
    }
    

    how do i sort the array of arrays by the last value?
  3. In Topic: dont understand array_multisort

    Posted 21 Aug 2012

    Quote

    Warning: Division by zero in C:\xampp\htdocs\tmp\userlist.php on line 97

    Warning: array_multisort() [function.array-multisort]: Array sizes are inconsistent in C:\xampp\htdocs\tmp\userlist.php on line 100

    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\tmp\userlist.php on line 103

    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\tmp\userlist.php on line 104

    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\tmp\userlist.php on line 104


    And there are complete wrong values in the output.

    As I said, I saw the code on php.net. I've got no clue what or how the multisort works...
    http://php.net/manua...y-multisort.php
  4. In Topic: string.replace() problems

    Posted 20 Jul 2012

    as for now on i'll just assign everything to a "new" variable ;)
  5. In Topic: string.replace() problems

    Posted 20 Jul 2012

    hmm why does JS just dont sound logic to me...
    sometimes it need to assign it to a variable, sometimes it doesnt :(

    i'll give it a try and hope it'll work :)

My Information

Member Title:
blub
Age:
21 years old
Birthday:
June 4, 1991
Gender:
Location:
Switzerland
Years Programming:
2
Programming Languages:
Java, C, VB6, PHP, JSP, HTML&CSS

Contact Information

E-mail:
Private
Website URL:
Website URL  http://www.virtualeffect.ch

Friends

Toxicterror hasn't added any friends yet.

Comments

Page 1 of 1
  1. Photo

    Vip3rousmango Icon

    23 Apr 2011 - 18:54
    Thanks for the rep! It would be pretty cool if we could do that with CSS normally. Saves me so much time!
Page 1 of 1