JSON中的PHP if-else条件用于更改fullcalendar中的事件颜色

<?php
header("Access-Control-Allow-Origin: *");
header('Content-type:application/json');

mysql_connect('localhost','root','') or die(mysql_error());

mysql_select_db('pmothesis');

$select = mysql_query("SELECT * FROM venue_reservations join venue on venue.venue_code = venue_reservations.venue_code join office on office.office_id = venue_reservations.office_id where status != 'Finished'");

$rows = array();

while ($row = mysql_fetch_array($select))
{
    $rows[] = array('id'=>$row['venue_reservation_id'],
                    'title'=>$row['venue_name'],
                    'start'=>$row['date_time_start'],
                    'end'=>$row['date_time_end'],
                    'description'=>"Purpose: ".$row['purpose'].
                    ' <br> Venue reservation id: ' .$row['venue_reservation_id'].
                    ' <br> Event type: ' .$row['event_type'].
                    ' <br> Number of persons: ' .$row['number_of_persons'].
                    ' <br> Office name: ' .$row['office_name'].
                    ' <br> <br> Status: <font style="color: red;"> ' .$row['status']. ' </font>'
                    );
}



echo json_encode($rows);
?>

That is my JSON file. I want to change the event color of my fullcalendar. I have certain conditions related to reservation approval. For example, if it's already approved, the event will change into color blue from red which is pending. Your answers are highly appreciated. Thank you :)

As suggested by @MarcB, you need an if and a $color :

while ($row = mysql_fetch_array($select))
{   if ( $row['status'] == "approved" )     //<========= CHECK STATUS HERE.
         $color = "blue";
    else $color = "red";
    $rows[] = array('id'=>$row['venue_reservation_id'],
                    'title'=>$row['venue_name'],
                    'start'=>$row['date_time_start'],
                    'end'=>$row['date_time_end'],
                    'description'=>"Purpose: ".$row['purpose'].
                    ' <br> Venue reservation id: ' .$row['venue_reservation_id'].
                    ' <br> Event type: ' .$row['event_type'].
                    ' <br> Number of persons: ' .$row['number_of_persons'].
                    ' <br> Office name: ' .$row['office_name'].
                    ' <br> <br> Status: <font style="color: ' . $color . ';"> ' . //<========= COLOR VARIABLE.
                    $row['status']. ' </font>'
                    );
}

As you have read in the comments, it's time to stop using mysql and change to mysqli (or PDO) and start using CSS classes.