Jump to content

MrXHellboy

Members
  • Posts

    153
  • Joined

  • Last visited

    Never

Posts posted by MrXHellboy

  1. The post above here will describe my tables... This is the result now:

    Laurens Skills: Football

    Max Skills: Football

    Laurens Skills: Football

    Max Skills: Swimming

    Max Skills: Football

    Laurens Skills: Swimming

    Laurens Skills: Football

    Laurens Skills: Football

    Laurens Skills: Swimming

     

    As you can see (dont pay attention to the skills), just a test, it will result in name -> skill, done with the following code:

    $Query = "SELECT name, skill FROM members as a INNER JOIN skills as b ON a.id = b.member_id";
    
    $result = mysql_query($Query)
                        or die ('Something went wrong!');
                        
                        
    while ($row = mysql_fetch_object($result))
    {
        echo $row->name.' Skills: '. $row->skill.'<br />';
    }
    

     

    I want to have:

    Laurens: -> All the skills

    Max: -> All the skills

     

    Not name and skill, time after time

  2. Unfortunately it didnt work out..

     

    My member table has 3 fields -- id, name, nickname

    My Skills table has has 3 fields -- id, member_id , skill

     

    Maybe this is helpfull ?

  3. I have a simple query:

    SELECT name, skill FROM members as a LEFT JOIN skills as b ON a.id = b.member_id

     

    For instance, we have 1 name with 4 skills. Within a loop it will result in 4 times the name, followed with the skill.

     

    But i want to have 1 name with all of the skills. Not 4 times the name with each time a other skill. Group By name results in 1 single name with 1 single skill while he has 4 skills.

     

    Someone has a solution ?

  4. Just out of curiosity

     

     

    When changing the php.ini file "max_execution_time" to 5, it still looks like it takes 30 seconds.

     

    However, you will receive an fatal error which states  max exec time of 5 seconds exceeded....  :shrug:

     

    Anyone ?

     

    No safe mode, did try set_time_limit....

  5. Then you have to check whether the input fields are empty... The same with your query

     

    Something like:

    if ($_POST['State1'] != '')
    // query
    
    if ($_POST['State2'] != '')
    // query
    

     

    I hope this helps because i still dont get it what you want exactly......

  6. // Seed generator
    mt_srand((double)microtime()*1000000);
    
    //All your player ids in an array
    $players = array();
    
    // Shuffle array
    shuffle($players);
    
    // Random array index
    $random = mt_rand(0, count($players));
    
    // final winner
    $winner = $players[$random];
    
    

     

    I dont know what you want exactly but maybe this helps....

     

  7. Hi All,

     

    I created this simple function to generate random doubles..... Please your opinions!

     

    function GetRandomFloatNumber($min = false, $max = false, $dec_min = false, $dec_max = false)
    {
    // Seed the generator
    mt_srand((double)microtime()*1000000);
    
    // Set the default min and max if no parameter has been passed
    if ($min === false)
    	$min = 0;
    if ($max === false)
    	$max = mt_getrandmax();
    if ($dec_min === false)
    	$dec_min = 0;
    if ($dec_max === false)
    	$dec_max = mt_getrandmax();
    // units
    $units = mt_rand($min, $max);
    // Decimals
    $decimals = mt_rand($dec_min, $dec_max);
    // Set double
    $doublenumber = $units.'.'.$decimals;
    // Return double
    return $doublenumber;
    }
    

  8. Hi All,

     

    The php.ini contains a nice option called max_execution_time...

     

    I know there is a way to reduce this to 5 seconds for example, by NOT altering the php.ini.....

     

    What was this function, i cant find it anymore :(

     

    Cheers

×
×
  • 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.