· 9 years ago · Dec 20, 2016, 03:18 AM
1$sql = "CREATE TABLE IF NOT EXISTS " . $wpdb->prefix.SSM_ACADEMIC_YEAR_TABLE. " (
2 id mediumint(12) NOT NULL AUTO_INCREMENT,
3 academicyear VARCHAR(200) NOT NULL,
4 begin_date date NOT NULL,
5 end_date date NOT NULL,
6 created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
7 PRIMARY KEY (id));";
8
9 $wpdb->query($sql);
10
11$current_year = array(
12 'academicyear' => '2012 - 2013',
13 'begin_date' => date('Y-m-d', '2012-08-14'),
14 'end-date' => date('Y-m-d', '2013-05-31')
15 );
16
17 $wpdb->insert($wpdb->prefix.SSM_ACADEMIC_YEAR_TABLE, $current_year);
18
19'begin_date' => date('Y-m-d', strtotime('2012-08-14')),
20
21<?php $time = current_time( 'mysql' ); ?>