Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/31/2021 in all areas

  1. Getting better!. Change to $match[] = array( 'p1' => $related_user_1[ 0 ][ 'ID' ], 'p2' => $related_user_2[ 0 ][ 'ID' ], 's1p1' => $set_1_player_1[0] ?? '', 's1p2' => $set_1_player_2[0] ?? '', 's2p1' => $set_2_player_1[0] ?? '', 's2p2' => $set_2_player_2[0] ?? '', 's3p1' => $set_3_player_1[0] ?? '', 's3p2' => $set_3_player_2[0] ?? '', ); That should change the array from [11] => Array ( [p1] => Sam Bina [p2] => Frank Molino [s1p1] => Array ( [0] => 6 ) [s1p2] => Array ( [0] => 4 ) [s2p1] => Array ( [0] => 6 ) [s2p2] => Array ( [0] => 4 ) [s3p1] => Array ( ) [s3p2] => Array ( ) ) to [11] => Array ( [p1] => Sam Bina [p2] => Frank Molino [s1p1] => 6 [s1p2] => 4 [s2p1] => 6 [s2p2] => 4 [s3p1] => [s3p2] => )
    1 point
  2. Este é um fórum de língua inglesa.
    1 point
  3. When looking for variables to interpolate in a string, PHP identifies them by the $. Your self:: or Post:: is not being considered as part of the variable because they are before the $. So PHP is looking for a local variable $table which doesn't exist and your query would be "SELECT * FROM self:: WHERE ...". To use your static variable, you need to concatenate it, not rely on interpolation. $query = mysqli_query($this->conn, "SELECT * FROM ".self::$table." WHERE type='breaking' ORDER BY RAND()"); They aren't. Your class has only one variable named $table, but it's "class-level" rather than "instance-level". You use $this-> to access instance-level variable and a static reference (ie, self::) to access class-level variables. Using $this-> to access a static variable is improper.
    1 point
  4. Rinse and repeat - exchanging u1 and u2 $new = []; foreach ($array as $a) { if (!isset($new[$a['u1']])) { $new[$a['u1']] = []; } $new[$a['u1']][] = $a['u2']; //repeat exchanging u1 and u2 if (!isset($new[$a['u2']])) { $new[$a['u2']] = []; } $new[$a['u2']][] = $a['u1']; } // // Output $new array // echo '<pre>'; foreach ($new as $u1 => $u2s) { printf('<br><b>%4d</b> | ', $u1); foreach ($u2s as $u) { printf('%4d &vellip;', $u); } }
    1 point
  5. In case anyone comes here and wants to know what the answer was, since that wasn't shared, Problem 1 - phpunit/phpunit[9.3.3, ..., 9.5.x-dev] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension. - Root composer.json requires phpunit/phpunit ^9.3.3 -> satisfiable by phpunit/phpunit[9.3.3, ..., 9.5.x-dev]. phpunit requires ext-dom (aka the DOM extension) but apparently it's missing. Install it.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.