What is the correct syntax for querying column types in a MySQL query in PHP?

When querying column types in MySQL using PHP, you can use the `DESCRIBE` statement followed by the table name to get information about the columns in the table, including their data types. This can be useful when you need to dynamically generate queries or validate input data against the expected column types in a database table.

<?php
// Connect to MySQL database
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database";

$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Query to get column types
$sql = "DESCRIBE table_name";
$result = $conn->query($sql);

// Loop through the results
while($row = $result->fetch_assoc()) {
    echo "Column: " . $row['Field'] . ", Type: " . $row['Type'] . "<br>";
}

// Close connection
$conn->close();
?>