Barand Posted March 23, 2019 Share Posted March 23, 2019 is display_startup_errors set ON? Quote Link to comment https://forums.phpfreaks.com/topic/308505-looking-to-sum-2-separate-columns-as-each-not-together/page/2/#findComment-1565579 Share on other sites More sharing options...
freebs Posted March 23, 2019 Author Share Posted March 23, 2019 it is now.. thanks! I missed that.. Quote Link to comment https://forums.phpfreaks.com/topic/308505-looking-to-sum-2-separate-columns-as-each-not-together/page/2/#findComment-1565580 Share on other sites More sharing options...
Barand Posted March 23, 2019 Share Posted March 23, 2019 If you go back to my original line 29, does it now report the error? Quote Link to comment https://forums.phpfreaks.com/topic/308505-looking-to-sum-2-separate-columns-as-each-not-together/page/2/#findComment-1565581 Share on other sites More sharing options...
freebs Posted March 23, 2019 Author Share Posted March 23, 2019 let me check.. .. it does now after I restarted httpd.. thanks.. that help me out alot.. lol Quote Link to comment https://forums.phpfreaks.com/topic/308505-looking-to-sum-2-separate-columns-as-each-not-together/page/2/#findComment-1565582 Share on other sites More sharing options...
freebs Posted March 24, 2019 Author Share Posted March 24, 2019 Hey Barand.. sorry to bug you again.. but how would I get the horizontal lines back in the table? I had them in a style.css.. but this <?=$tdata?> can't seem to be manipulated. Quote Link to comment https://forums.phpfreaks.com/topic/308505-looking-to-sum-2-separate-columns-as-each-not-together/page/2/#findComment-1565588 Share on other sites More sharing options...
Barand Posted March 24, 2019 Share Posted March 24, 2019 Add your styling to the <td>s etc when the $tdata is being built EG foreach ($res as $row) { $tot_value += $row['value']; $tot_balance += $row['balance']; // accumulate totals as they are fetched $tdata .= "<tr><td>{$row['work_order']}</td> <td>{$row['customer']}</td> <td>{$row['description']}</td>"; $tdata .= '<td class="ra">' . toCurrency($row['value']) . '</td>'; // right-align cell $tdata .= '<td class="ra">' . toCurrency($row['balance']) . '</td>'; // right-align cell $tdata .= "<td>{$row['status']}</td> <td>{$row['notes']}</td></tr>"; } $tdata .= "<tr><th colspan='3' class='ra'>Totals</th><td class='ra total'>" . toCurrency($tot_value) . '</td><td class="ra total">' . toCurrency($tot_balance) . "</td><td colspan='2'></td></tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/308505-looking-to-sum-2-separate-columns-as-each-not-together/page/2/#findComment-1565589 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.