How can I format the row values from server to client?

How can I format the row values from server to client?

ianrivereianrivere Posts: 3Questions: 2Answers: 0
edited May 2021 in Editor

Hello,

I am having trouble formatting the values I am passing to the client-side table. I am trying a custom getFormatter but I haven't figured it out. On the SQL, I have a column called "appointment_type" with the row values "i" and "o". I want to display these values as "In-Person" (i) and "Online" (o) to the client.

This is the condition I'm trying to fulfill if it helps:

while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($row['appointment_type'] == "i") {
$row['appontment_type'] = "In-Person";
} else {
$row['appontment_type'] = "Online";
}

Thank you!

This question has accepted answers - jump to:

Answers

This discussion has been closed.