$stmt->execute(); $stmt->bind_result($id, $title, $type_id, $type_title); $results = array(); $i = 0; while ($stmt->fetch()) { $results[$i]['id'] = $id; $results[$i]['title'] = $title; $results[$i]['type_id'] = $type_id; $results[$i]['type_title'] = $type_title; $i++; } $stmt->close(); $mysqli->close(); return $results; } $tiles = getTile($tile_id, $DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE); $types = getTypes($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE); $categories = getCategories($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE); $typesCount = count($types); $categoriesCount = count($categories); ?> <html> <head> <title>Edit Tile</title> <?php include 'includes/head.php'; ?> </head> <body> <?php foreach ($tiles as $tile) {
function getBoard($a, $s, $id) { $szHtml = '<table id="' . $id . '">'; foreach ($a as $k => $t) { if (0 == $k % $s) { $szHtml .= '<tr>'; } $szHtml .= '<td>' . getTile($t) . '</td>'; if (0 == ($k + 1) % $s) { $szHtml .= '</tr>'; } } $szHtml .= '</table>'; return $szHtml; }