Read about OpenEMR's Response to the COVID-19 Pandemic at

Not able to fetch data for recurrence appointment from backend table name openemr_postcalendar_events

In openemr database Table ‘openemr_postcalendar_events’ store appointment details .
For a single appointment, we can able to see data is there in the column ‘Pc_eventDate’.

But for recurrence appointment it stores data in column ‘pc_recurrtype’,‘pc_recurrspec’ and ‘pc_recurrfreq’.
column pc_recurrfreq its store some json like format given below

1.on recurrence Mon/Tue/wed/Thurs/friday/saturday:

2. on recurrence each day form select dropdown:

can anyone tell exactly how this recurrence data can fetch from the query .
also refer some git openemr code for the same module, but didn’t able to figure it out.

Thanks in advanced.


Once you execute the query on the openemr_postcalendar_events table from php you need to pass that column to the json_decode function into the PHP it will convert that data in object data type of PHP and then you can fields you want or property you want inside the Jason.


Hello Nilesh,

I know about the json parsing process.
I tried with same approach but still its returns me data as NULL.No use .

$sql =“SELECT * FROM openemr_postcalendar_events WHERE pc_eid=15”;
$getstmt = $conn->prepare($sql);
while($getrow = $getstmt->fetch(PDO::FETCH_ASSOC)){
$jsondata =$getrow[‘pc_recurrspec’];
var_dump( json_decode($jsondata)); //returns null

i am looking more for what data exactly it is?meaning of the data that comes in json and how to access it exactly. Because json store in column is not exact json as i give example in attached post.
if any futher details / information let me know.