How can the output of a mysql_query be sorted based on specific words like 'progress', 'active', and 'inactive'?

To sort the output of a MySQL query based on specific words like 'progress', 'active', and 'inactive', you can use the ORDER BY FIELD() function in your SQL query. This function allows you to specify the order in which the results should be sorted based on the values of a specific column.

$query = "SELECT * FROM your_table ORDER BY FIELD(status, 'progress', 'active', 'inactive')";
$result = mysql_query($query);

// Fetch and display the sorted results
while($row = mysql_fetch_assoc($result)) {
    // Display each row here
}