<?php
$dbhost = "localhost";
$dbname = "cyberbotnet";
$dbuser = "root";
$dbpass = "Cyberproduct123!@#";

$condb = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);

if (!$condb) {
    file_put_contents(__DIR__ . '/db_check_output.txt', "Connection failed: " . mysqli_connect_error());
    exit;
}

$output = "Table Structure:\n";
$result = mysqli_query($condb, "DESCRIBE logs");
while ($row = mysqli_fetch_assoc($result)) {
    $output .= print_r($row, true);
}

$output .= "\nRecords:\n";
$result = mysqli_query($condb, "SELECT * FROM logs");
while ($row = mysqli_fetch_assoc($result)) {
    $output .= print_r($row, true);
}

mysqli_close($condb);
file_put_contents(__DIR__ . '/db_check_output.txt', $output);
?> 