Why are the XXX_time values in the database set as int(11) if int can only hold up to 10 digits?

The XXX_time values in the database are set as int(11) because the int data type in MySQL can hold up to 11 digits, not just 10. The number in parentheses in int(11) refers to the display width, not the maximum number of digits it can hold. Therefore, int(11) can store values ranging from -2147483648 to 2147483647.

// To store timestamps in MySQL database using int(11) data type
// You can use the PHP time() function to get the current Unix timestamp
$current_timestamp = time();

// To store the timestamp in the database
$query = "INSERT INTO table_name (XXX_time) VALUES ($current_timestamp)";
// Execute the query using your preferred method (mysqli_query, PDO, etc.)