<?php include "functions.php"; $arr_table_values = get_table_values("db_version"); $arr_table = array(); for ($i = 0; $i < count($arr_table_values); $i++) { array_push($arr_table, $arr_table_values[$i]); } echo json_encode($arr_table); mysqli_close($connection);
<?php include "functions.php"; $table_name = "kids"; $arr_column = get_table_fields($table_name); $arr_table_values = get_table_values($table_name); $str = "CREATE TABLE IF NOT EXISTS " . $table_name . " ("; foreach ($arr_column as $key => $value) { $str .= $value['Field'] . " " . get_field_value($value) . ", "; } $str = rtrim($str, ", "); $str .= ")&#"; //echo "<pre>"; //print_r($arr_table_values); //echo "</pre>"; foreach ($arr_table_values as $key => $value) { $str .= build_insert_str($table_name, $value) . "&#"; } //header("Content-Type: text/html charset=utf-8"); $str = utf8_encode(nl2br(rtrim($str, "&#"))); echo json_encode($str); mysqli_close($connection);
?> <div class="container"> <h3 style="margin-top: 30px; margin-bottom: 15px; color: brown;">People Attending for <?php echo $event_name; ?> </h3> <div class='pull-right'> <h4 style="padding: 15px; color: brown;">Grand Total:  <?php echo $total; ?> </h4> </div> <?php include "functions.php"; $events = get_table_values("events"); //print_r($events); ?> <table class = "table"> <tr> <th>S.No.</th> <th>Name</th> <th>Self</th> <th>Wife</th> <th>Kids</th> <th>Guest</th> <th>Total</th> </tr> <tr>