<?php
// Script to add BrandIcon column to tblbrand table
include('includes/dbconnection.php');

// Check if column exists
$check_column = mysqli_query($con, "SHOW COLUMNS FROM tblbrand LIKE 'BrandIcon'");
$column_exists = mysqli_num_rows($check_column) > 0;

if (!$column_exists) {
    // Add the column if it doesn't exist
    $alter_query = mysqli_query($con, "ALTER TABLE tblbrand ADD COLUMN BrandIcon varchar(255) DEFAULT NULL AFTER BrandName");
    
    if ($alter_query) {
        echo "BrandIcon column added successfully to tblbrand table.";
    } else {
        echo "Error adding BrandIcon column: " . mysqli_error($con);
    }
} else {
    echo "BrandIcon column already exists in tblbrand table.";
}
?>