Jump to content

Leaderboard

  1. Barand

    Barand

    Moderators


    • Points

      5

    • Content Count

      20,896


  2. requinix

    requinix

    Administrators


    • Points

      2

    • Content Count

      12,370


  3. mac_gyver

    mac_gyver

    Staff Alumni


    • Points

      1

    • Content Count

      4,438


  4. StevenOliver

    StevenOliver

    Members


    • Points

      1

    • Content Count

      166



Popular Content

Showing content with the highest reputation since 06/27/2020 in Posts

  1. 2 points
    I enjoy the challenge when someone posts a problem I can get my teeth into.
  2. 1 point
    Perhaps you would like to be so much like an AI bot it's funny. me made your day?
  3. 1 point
    That's pretty much exactly what I said you needed to do, so...
  4. 1 point
    I created an extra table to define which category the values were in mysql> select * from catval; +-----+------+ | val | cat | +-----+------+ | 1 | 4 | | 2 | 4 | | 3 | 4 | | 4 | 4 | | 5 | 3 | | 6 | 3 | | 7 | 2 | | 8 | 2 | | 9 | 1 | | 10 | 1 | +-----+------+ then $sql = "SELECT a.cat as cata , b.cat as catb FROM datatb d JOIN catval a ON d.grpa = a.val JOIN catval b ON d.grpb = b.val "; $result = $db->query($sql); //categories $cat = [ 4 => ['name'=>'1:4', 'recs'=>[]], 3 => ['name'=>'5:6', 'recs'=>[]], 2 => ['name'=>'7:8', 'recs'=>[]], 1 => ['name'=>'9:10','recs'=>[]] ]; $n = 0; while ($row = $result->fetch_assoc()) { $cat[$row['cata']]['recs'][$n][] = $row['cata']; $cat[$row['catb']]['recs'][$n][] = $row['catb']; $n++; } // the output echo "<table border='1' style='width:500px; border-collapse:collapse;'>"; foreach ($cat as $c) { echo "<tr><th>{$c['name']}</th>"; for ($i=0; $i<$n; $i++) { echo '<td style="text-align:center;">' . (isset($c['recs'][$i]) ? join(',', $c['recs'][$i]) : '&ndash;') . "</td>"; } echo "</tr>\n"; } echo "</table>\n";
  5. 1 point
    perhaps $table .= join(',', $columnValue);
  6. 1 point
    You don't say what data type '$columnValue' is so I am assuming it is int. $table .= strval($columnValue);
  7. 1 point
    the most immediate problem is you have a logic 'hole' in the username/password check, where not all possibilities are addressed. when you use negative logic, you must complement both the conditional comparison in each term and the logic combining the terms. the complement of - if(a == b && c == d) is if(a != b || c != d). it is not if(a != b && c != d), in general, you should avoid using negative logic. you also need to use php's password_hash() when registering/storing the initial submitted password and use password_verify() when testing if a submitted password matches the saved hashed value. also, don't use a loop to fetch the data from a query that will at most match one row. just directly fetch/test the result from the query. lastly, the recommendations given in your last thread, less the ones that were specific to an INSERT query, apply to what you are currently doing. using those recommendations will result in the least amount of code/variables.
  8. 1 point
    Very respectfully, are you really writing code for Online Banking? I'm hoping you're just doing a college class assignment.
  9. 1 point
    You could roll your own. function twoColorCircle($a, $b, $sz) { $out = "<svg width='$sz' height='$sz' viewBox='0 0 1000 1000'> <linearGradient id='grad2' x1='0' y1='0' x2='1' y2='0'> <stop offset='0%' style='stop-color:$a'/> <stop offset='50%' style='stop-color:$a'/> <stop offset='50%' style='stop-color:$b'/> <stop offset='100%' style='stop-color:$b'/> </linearGradient> "; $c = 500; $r = 499; $out .= "<circle cx='$c' cy='$c' r='$r' fill='url(#grad2)' stroke='#000' /> </svg>"; return $out; } foreach ([16,32,64,128,256] as $sz) echo twoColorCircle('#5fc75d' , '#f19e2d' , $sz); echo '<br>'; foreach (['16em','8em','4em','2em','1em'] as $sz) echo twoColorCircle('#5fc75d' , '#f19e2d' , $sz);
  10. 1 point
    Hello everyone, I am Abdellah and I an enthusiast PHP and Laravel developer. I do backend and frontend. I am from Cameroon and I am happy to be here. Thanks.
  11. 0 points
    Neil, you left out: Make a sandwich Take power nap $$$ Profit!
  12. 0 points
    1. Remove any PHP / Server Side code 2. Strip out any <img> tags 3. Strip out any <script> tags 4. Strip out any <link> tags to CSS files Job done. Should run like lightning!
This leaderboard is set to New York/GMT-04:00
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • 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.