<?php
$str_query = 'SELECT * FROM ' . $config['table_prefix'] . 'config WHERE name = "display_calendar_events"';
$row = sql_fetch_assoc(sql_query($str_query));
if (!$row) {
    run_query('INSERT INTO ' . $config['table_prefix'] . 'config (name, value) VALUES ("display_calendar_events", "0")');
}