Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/13/2021 in Posts

  1. Yes it was that simple. To keep your function cleaner I'd add the id value as an argument of the function as well function ($id, &$mail, &$rank)
    1 point
  2. Return the vars as arguments of the function with the & on each. "function xyz(&$a, &$b)" Call the function with "function ($a, $b)" and then use $a & $b in your following code. And - how does using an array of your two values cause duplication of code? Anyway - your question is either how do I return the values or how do I echo the values? Which do you want to do?
    1 point
  3. I'd do it this way $res = $db->query("SELECT status_to , COUNT(*) as tot FROM crm_log GROUP BY status_to "); $totals = array_column($res->fetchAll(), 'tot', 'status_to'); $heads = "<tr><th>" . join('</th><th>', array_keys($totals)) . "</th></tr>\n"; $vals = "<tr><td>" . join('</td><td>', $totals) . "</td></tr>\n"; ?> <table border='1'> <?=$heads?> <?=$vals?> </table>
    1 point
  4. doing it like that means that $params is required. The way I did it means that $params can be there or not
    1 point
This leaderboard is set to New York/GMT-04: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.