· 8 years ago · Jun 04, 2018, 10:22 AM
1CREATE TABLE IF NOT EXISTS `attendance` (
2 `aid` int(11) NOT NULL auto_increment,
3 `UserID` int(11) NOT NULL default '0',
4 `PracID` int(11) NOT NULL default '0',
5 `attended` enum('Yes','No','Apology') NOT NULL default 'No',
6 PRIMARY KEY (`aid`)
7) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
8
9
10CREATE TABLE IF NOT EXISTS `band_notes` (
11 `NoteID` int(32) NOT NULL auto_increment,
12 `EventID` int(11) NOT NULL default '0',
13 `UserID` int(50) NOT NULL default '0',
14 `Body` text NOT NULL,
15 PRIMARY KEY (`NoteID`)
16) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
17
18--
19-- Dumping data for table `band_notes`
20--
21
22INSERT INTO `band_notes` (`NoteID`, `EventID`, `UserID`, `Body`) VALUES
23(1, 133, 7, 'Times To Be Confirmed, The Band have asked for an early slot for the competition due to other engagements on the day.'),
24(2, 135, 7, '<br />\r\nThe Band have asked for an early slot for the competition, as we have a parade in Dalry that night ..'),
25(3, 136, 7, 'The Band have Requested a later time slot for the competition.'),
26(4, 137, 7, 'Morning Parade: Irvine <br />\r\nMain parade: Cambuslang <br />\r\nMeal <br />\r\nReturn Parade: Irvine'),
27(5, 138, 7, '<br />');
28
29
30DELETE FROM attendance, band_notes USING attendance INNER JOIN band_notes WHERE attendance.UserID = band_notes.UserID AND UserID = '1'
31
32// error
33#1052 - Column 'UserID' in where clause is ambiguous