如何匯總 html 表中的總行數 - 在 phpmyadmin 中綁定
我在 html 中有一個表格。正在使用 php 從 phpmyadmin 獲取數據。我想合計每一行中的值。請幫忙。<?php// Connect to the database$dbLink = new mysqli('localhost', 'root', '', 'ghsexam_database');if(mysqli_connect_errno()) {die("MySQL connection failed: ". mysqli_connect_error());}// Query for a list of all existing files$sql = 'SELECT `last_name`, `first_name`, `middle_initial`, `educ_attain`, `logic1`, `logic2`,`logic3`, `grammar1`, `grammar2`, `grammar3`, `grammar4`, `grammar5`, `ghs_essay`, `reading1`, `reading2`, `reading3`, `reading4`, `listening1`, `listening2` FROM `ghs_table` ';$result = $dbLink->query($sql);// Check if it was successfullif($result) {// Make sure there are some files in thereif($result->num_rows == 0) { echo '<p>There are no files in the database</p>';}else { // Print the top of a table echo '<center><table id=myTable table border=4 cellspacing=1 cellpadding=1 width="100%"> <tr class="header"> <th onclick="sortTable(0)" style="cursor:pointer; "nowrap="nowrap"><b>Last Name</b> <i class="fa fa-fw fa-sort"></i></th> <th onclick="sortTable(1)" style="cursor:pointer;" nowrap="nowrap"><b>First Name</b> <i class="fa fa-fw fa-sort"></i></th> <th onclick="sortTable(2)" style="cursor:pointer;" nowrap="nowrap"><b>Middle Initial</b><i class="fa fa-fw fa-sort"></i></th> <th onclick="sortTable(3)" style="cursor:pointer;" nowrap="nowrap"><b>Educational Attainment</b><i class="fa fa-fw fa-sort"></i></th> <th onclick="sortTable(4)" style="cursor:pointer;" nowrap="nowrap"><b>Logic:1:</b><i class="fa fa-fw fa-sort"></i></th> </tr>';我在這部分有問題。我想合計每一行的有限值。喜歡,1 1 1 1 1 = 5。在下面免費填寫評論。
查看完整描述