From: les_kopari Date: Wed, 24 Dec 2003 17:29:30 +0000 (+0000) Subject: Initial add. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=218cb966c59e21dd5827e4310f943a6eb719bdae;p=moodle.git Initial add. --- diff --git a/mod/attendance/db/schema.php b/mod/attendance/db/schema.php new file mode 100755 index 0000000000..313cfb5f55 --- /dev/null +++ b/mod/attendance/db/schema.php @@ -0,0 +1,29 @@ +debug = true; +$server = "false"; +$user = "scott"; +$password = "tiger"; +$db->Connect(false, $user, $password); +$rs = $db->Execute('select * from dept'); +print "
"; 
+print_r($rs->GetRows()); 
+print "
"; +rs2html($rs,'border=2 cellpadding=3',array('Deptno','DName','Loc')); +$dict = NewDataDictionary($db); +$rs = $db->Execute('drop table attendance'); +$schema = new adoSchema($db); +$rs = $db->Execute('drop table attendance_roll'); +$schema = new adoSchema($db); +$sql = $schema->ParseSchema("schema.xml"); +$result = $schema->ExecuteSchema( $sql ); +$sql = "insert into attendance(id,name,course,day,hours,roll,notes,timemodified,dynsection,edited,autoattend) values (2,'2',2,2,2,2,'2',2,2,2,2)"; +$rs = $db->Execute($sql); +$rs = $db->Execute('select * from attendance'); +rs2html($rs,'border=2 cellpadding=3',array('id','name','course','day','hours','roll','notes','timemodified','dynsection','edited','autoattend')); +?> + diff --git a/mod/attendance/db/schema.xml b/mod/attendance/db/schema.xml new file mode 100755 index 0000000000..9e688e98ca --- /dev/null +++ b/mod/attendance/db/schema.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + SQL to be executed only on specific platforms + + insert into mytable ( row1, row2 ) values ( 12, 'stuff' ) + + + insert into mytable ( row1, row2 ) values ( 12, 'different stuff' ) + + + insert into attendance(id,name,course,day,hours,roll,notes,timemodified,dynsection,edited,autoattend) values (1,'1',1,1,1,1,'1',1,1,1,1) + + +
+