Jump to content

Barand

Moderators
  • Posts

    24,604
  • Joined

  • Last visited

  • Days Won

    830

Everything posted by Barand

  1. The bankroll would become 450 only if you lost.
  2. If you win the first bet, you should then have 600. If you win, they pay you.
  3. return $bankroll = $bet * $odds - $bet + $bankroll; ^^^^^^ Are you sure you should be losing your stake when you win?
  4. One more question - is there a minimum bet? If it's 10% of the current bankroll and you keep losing, you could, at some point, be betting 0.0000000001 euros
  5. Clarification required. Your bet is 10%. Does that mean that, if you start with 500.00, you will always bet 50.00, or will your next bet be 10% of your current bankroll? You say 500 times, but what if you are unlucky and run out of cash?
  6. PHP v8 doesn't let you mix indeterminate types, such as adding an empty string to an int. $a = 1; $b = '2'; $c = ''; echo $a + $b; // 3 OK echo $a + $c; // Unsupported operand types: int + string echo $a + (int)$c; // 1 OK Use a cast to int. $this->hou += (int)$split[0]; That said, you really are doing the calculations the hard way $t1 = '09:30:00'; $t2 = '17:15:00'; $dt1 = new DateTime($t1); $dt2 = new DateTime($t2); echo $dt2->diff($dt1)->format('%H:%I:%S'); // 07:45:00
  7. The correct fix would be to use prepared queries. CSV files are expected to have "..." around some string values and fgetcsv() should allow for them. Perhaps there is something weird regarding their placement in your data.
  8. If you want to use silly names like that with the "." at the end then you need the column name inside backticks. SELECT `KNr.` FROM .... From MySQL manual
  9. Sorry. Not used to mysqli (I always use PDO). It should be fetch_row();
  10. I'd create and array of KNr's from the CSV and a second array of KNr's from your table then compare the arrays for differencess (array_diff() ) EDIT: Something like this $array1 = []; $array2 = []; $file = fopen($filename, "r"); while (($column = fgetcsv($file, 10000, ";")) !== FALSE) { $array1[] = $column[0]; } $res = $con->query("SELECT KN2 from adressen_neu"); while ($row = $res->fetch_num() ) { $array2[] = $row[0]; } echo '<pre>' . print_r(array_diff($array1, $array2), 1) . '</pre>';
  11. I've just spotted the "key" icon next to KNr ( I was expecting a separated to column to say which columns were keys) so it looks like that is the primary key. That makes your checking for missing records simple. You just need to see which KNr values are not in the db table but are in the csv file.
  12. Those ... tell us sweet FA (Why is phpmyadmin so useless?). What about my other question about unique identifiers>
  13. I was hoping to see which column was the primary key and if you had any other keys defined on any columns. That was why I requested the the output from SHOW CREATE TABLE. I can't see anything defined there, so is there anything in those records that uniquly identifies a record?
  14. What is your table's structure? SHOW CREATE TABLE adressen_neu;
  15. You are inserting using the slowest method possible. Are the missing rows always from the end of the CSV file, or is it skipping rows from the middle?
  16. Perhaps... <link rel='stylesheet' href='https://www.w3schools.com/w3css/4/w3.css'> <form id="form1"> <div class='w3-container w3-display-topright w3-light-gray w3-third' > <div class='w3-cell-row w3-padding-small'> <div class='w3-container w3-cell' style='width:120px'>Email</div> <div class='w3-container w3-cell'> <input class='w3-input w3-card w3-tiny' type='text' name='email'> </div> </div> <div class='w3-cell-row w3-padding-small'> <div class='w3-container w3-cell' style='width:120px'>Password</div> <div class='w3-container w3-cell'> <input class='w3-input w3-card w3-tiny' type='text' name='password'> </div> </div> <div class='w3-cell-row w3-padding-small'> <div class='w3-container w3-cell w3-right' style='width: 60%'> <button class='w3-btn w3-small w3-light-grey w3-border w3-right'>LogIn</button> </div> </div> </div> </form> Laptop... Mobile...
  17. This is how your output looks in my browser window (Firefox). No idea what it's supposed to look like if that's wrong.. Your inline styles on input fields are a bit off Both have two width settings (5% and 150px) and both the 150px settings have syntax errors the first has a semi-colon instead of a colon the second has "="
  18. +-----------------+ +-----------------+ | checkout page | | Server | |-----------------| AJAX request |-----------------| | Send | -----------------------------> | Update DB | | | with product data | | | | | | | | | | | | | | Process | <---------------------------- | return response | | response | | | | | | | | | | | | | | | +-----------------+ +-----------------+
  19. A javascript/AJAX process is a common alternative
  20. If you need conditional branches of that nature in your method code then I think it's time to consider a separate class or subclass.
  21. I haven't a clue. It's just test data. Could just as well be [ 'X', 'Y', 'Z' ]
  22. This may be closer $allowed_roles = ['subscriber', 'visitor']; $user_roles = [ 'A' => ['subscriber', 'editor'], 'B' => ['subscriber', 'other', 'visitor'], 'C' => ['manager', 'visitor'], 'D' => ['manager', 'editor' ] ]; foreach ($user_roles as $uid => $roles) { if ( count( array_intersect($roles, $allowed_roles)) == count($allowed_roles) ) { echo "$uid &check;<br>"; } else { echo "$uid &times;<br>"; } }
  23. Follow the "Powered by Invision Community" link at the bottom of this page
  24. It may be worth just checking a couple of basic settings. Run this script <?php phpinfo(); ?> Scroll down the output to the PDO section check that there is one check that "mysql" is one of the installed drivers If not, enable them in your php.ini file
  25. PS If you want the ID to be the key in the categories array, use $categories = array_column($array, $column, 'id'); // get the category values with id as the key
×
×
  • 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.