<?php
include('../includes/config.php');
if (!$con) {
    die("Connection failed: " . mysqli_connect_error());
}

$start = microtime(true);
$sql = file_get_contents('alter_products.sql');

if (mysqli_multi_query($con, $sql)) {
    do {
        /* store first result set */
        if ($result = mysqli_store_result($con)) {
            while ($row = mysqli_fetch_row($result)) {
                printf("%s\n", $row[0]);
            }
            mysqli_free_result($result);
        }
    } while (mysqli_next_result($con));
    echo "Columns added successfully";
} else {
    echo "Error adding columns: " . mysqli_error($con);
}

$end = microtime(true);
echo "\nExecution time: " . ($end - $start) . " seconds";
?>
