Jump to content

New to MySQL and Need some help


jdubwelch

Recommended Posts

I've got three tables: plays, formations, sets

I'm trying to select just certain data from all three tables.  I can do that using the following:
[code]SELECT formations.formation, sets.`set`, plays.play_name
FROM plays
LEFT JOIN sets ON plays.set_id = sets.set_id
LEFT JOIN formations ON plays.formation_id = formations.formation_id[/code]

I have to use the ` around sets like this: `set` otherwise i get an error that says: [quote]#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set , plays . play_name  FROM plays  LEFT JOIN sets ON plays . set_id = sets . s' at line 1 [/quote]  Why is that?

secondly, i want to select the formation, set, and play_name that have the 'SHOTGUN' formation.  So i do this:
[code]SELECT formations.formation, sets.`set` , plays.play_name
FROM plays
LEFT JOIN sets ON plays.set_id = sets.set_id
LEFT JOIN formations ON plays.formation_id = formations.formation_id
WHERE (
formations.formation =  'SHOTGUN'
);

MySQL said:
#1194 - Table 'plays' is marked as crashed and should be repaired [/code]

here's the layout of my database if you need it:

[code]CREATE TABLE `formations` (
  `formation_id` int(10) unsigned NOT NULL auto_increment,
  `formation` varchar(50) NOT NULL,
  PRIMARY KEY  (`formation_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dumping data for table `formations`
--

INSERT INTO `formations` VALUES (6, 'GOALLINE');
INSERT INTO `formations` VALUES (5, 'SHOTGUN');
INSERT INTO `formations` VALUES (4, 'WEAK');
INSERT INTO `formations` VALUES (3, 'STRONG');
INSERT INTO `formations` VALUES (2, 'I-FORM');
INSERT INTO `formations` VALUES (1, 'ACE');
INSERT INTO `formations` VALUES (7, 'HAILMARY');

-- --------------------------------------------------------

--
-- Table structure for table `plays`
--

CREATE TABLE `plays` (
  `play_id` int(10) unsigned NOT NULL auto_increment,
  `formation_id` int(11) NOT NULL,
  `set_id` int(11) NOT NULL,
  `play_name` varchar(25) NOT NULL,
  `play_type` varchar(20) NOT NULL,
  `type_id` int(11) NOT NULL,
  `play_variable` tinyint(3) NOT NULL,
  PRIMARY KEY  (`play_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=221 ;

--
-- Dumping data for table `plays`
--

INSERT INTO `plays` VALUES (1, 1, 1, 'Drive Comeback', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (2, 1, 1, 'HB Dive', 'Run', 1, 1);
INSERT INTO `plays` VALUES (3, 1, 1, 'PA Strike', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (4, 1, 1, 'Backside Post', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (5, 1, 1, 'HB Counter', 'Run', 12, 1);
INSERT INTO `plays` VALUES (6, 1, 1, 'Drag Under', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (7, 1, 1, 'Flood', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (8, 1, 1, 'HB Slam', 'Run', 1, 1);
INSERT INTO `plays` VALUES (9, 1, 1, 'PA Rollout', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (10, 1, 1, 'Mesh', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (11, 1, 1, 'HB Toss', 'Run', 2, 1);
INSERT INTO `plays` VALUES (12, 1, 1, 'Reverse Whip', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (13, 1, 1, 'Spacing', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (14, 1, 1, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (15, 1, 1, 'Vertical', 'Pass', 8, 1);
INSERT INTO `plays` VALUES (16, 2, 2, 'Counter Lead', 'Run', 12, 1);
INSERT INTO `plays` VALUES (17, 2, 2, 'PA Screen', 'Pass', 10, 2);
INSERT INTO `plays` VALUES (18, 2, 2, 'FB Dive', 'Run', 1, 1);
INSERT INTO `plays` VALUES (19, 2, 2, 'HB Iso', 'Run', 1, 1);
INSERT INTO `plays` VALUES (20, 2, 2, 'PA FB Flat', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (21, 2, 2, 'HB Zone', 'Run', 13, 1);
INSERT INTO `plays` VALUES (22, 2, 2, 'Motion All Go', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (23, 2, 2, 'HB Slam', 'Run', 1, 1);
INSERT INTO `plays` VALUES (24, 2, 2, 'PA Boot', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (25, 2, 2, 'PA Toss Screen', 'Pass', 14, 2);
INSERT INTO `plays` VALUES (26, 2, 2, 'Lead Toss', 'Run', 2, 1);
INSERT INTO `plays` VALUES (27, 2, 2, 'China Special', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (28, 2, 2, 'Weak Counter', 'Run', 12, 1);
INSERT INTO `plays` VALUES (29, 2, 2, 'PA TE Drag', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (30, 2, 2, 'Triple Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (31, 3, 3, 'Counter Weak', 'Run', 12, 1);
INSERT INTO `plays` VALUES (32, 3, 3, 'WR Crosses', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (33, 3, 3, 'FB Over', 'Run', 1, 1);
INSERT INTO `plays` VALUES (34, 3, 3, 'HB Sting', 'Run', 1, 1);
INSERT INTO `plays` VALUES (35, 3, 3, 'PA End Around', 'Pass', 9, 2);
INSERT INTO `plays` VALUES (36, 3, 3, 'End Around', 'Run', 2, 1);
INSERT INTO `plays` VALUES (37, 3, 3, 'HB Dive', 'Run', 1, 1);
INSERT INTO `plays` VALUES (38, 3, 3, 'PA HB Flat', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (39, 3, 3, 'Toss Strong', 'Run', 2, 1);
INSERT INTO `plays` VALUES (40, 3, 3, 'HB Read', 'Run', 13, 1);
INSERT INTO `plays` VALUES (41, 3, 3, 'PA Boot', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (42, 3, 3, 'HB Slam', 'Run', 1, 1);
INSERT INTO `plays` VALUES (43, 3, 3, 'Triple Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (44, 3, 3, 'WR Corners', 'Pass', 7, 1);
INSERT INTO `plays` VALUES (45, 3, 3, 'Tr Option Rev', 'Run', 3, 3);
INSERT INTO `plays` VALUES (46, 5, 4, 'Slot Corner', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (47, 5, 4, 'Double Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (48, 5, 4, 'Option Pass', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (49, 5, 4, 'Angle', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (50, 5, 4, 'HB Off Tackle', 'Run', 1, 1);
INSERT INTO `plays` VALUES (51, 5, 4, 'PA F Slide', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (52, 5, 4, 'WR Unders', 'Pass', 5, 1);
INSERT INTO `plays` VALUES (53, 5, 4, 'QB Wrap', 'Run', 3, 2);
INSERT INTO `plays` VALUES (54, 5, 4, 'RB Deep', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (55, 5, 4, 'Dbl RB Opt Lt', 'Run', 3, 3);
INSERT INTO `plays` VALUES (56, 5, 4, 'Strike', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (57, 5, 4, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (58, 5, 4, 'Slants', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (59, 5, 4, 'QB Slot Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (60, 5, 4, 'WR Middle', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (61, 5, 4, 'In N'' Up', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (62, 5, 4, 'HB Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (63, 5, 4, 'PA Corner', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (64, 5, 5, 'All Curls', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (65, 5, 5, 'Inside Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (66, 5, 5, 'PA Middle', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (67, 5, 5, 'Clear FL Under', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (68, 5, 5, 'Bunch Toss Rt', 'Run', 2, 1);
INSERT INTO `plays` VALUES (69, 5, 5, 'Fork Angle', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (70, 5, 5, 'PA Read', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (71, 5, 5, 'QB Choice', 'Run', 3, 2);
INSERT INTO `plays` VALUES (72, 5, 5, 'Corner Combo', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (73, 5, 5, 'Cross Wheel', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (74, 5, 5, 'HB Zone', 'Run', 13, 1);
INSERT INTO `plays` VALUES (75, 5, 5, 'FL Special', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (76, 5, 5, 'HB Direct', 'Run', 2, 1);
INSERT INTO `plays` VALUES (77, 5, 5, 'HB Out', 'Pass', 7, 5);
INSERT INTO `plays` VALUES (78, 5, 5, 'QB Power', 'Run', 1, 1);
INSERT INTO `plays` VALUES (79, 5, 5, 'HB Screen', 'Pass', 10, 5);
INSERT INTO `plays` VALUES (80, 5, 5, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (81, 5, 5, 'Option Pass', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (82, 5, 6, 'Curl Flat', 'Pass', 5, 5);
INSERT INTO `plays` VALUES (83, 5, 6, 'HB Off Tackle', 'Run', 2, 1);
INSERT INTO `plays` VALUES (84, 5, 6, 'PA WR In', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (85, 5, 6, 'Corners', 'Pass', 8, 1);
INSERT INTO `plays` VALUES (86, 5, 6, 'Inside Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (87, 5, 6, 'HB Screen', 'Pass', 10, 1);
INSERT INTO `plays` VALUES (88, 5, 6, 'HB Corner', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (89, 5, 6, 'QB Power', 'Run', 1, 1);
INSERT INTO `plays` VALUES (90, 5, 6, 'Slot Cross', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (91, 5, 6, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (92, 5, 6, 'Option Pass', 'Pass', 9, 2);
INSERT INTO `plays` VALUES (93, 5, 6, 'HB Direct', 'Run', 2, 1);
INSERT INTO `plays` VALUES (94, 5, 6, 'PA Read', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (95, 5, 6, 'QB Choice', 'Run', 3, 2);
INSERT INTO `plays` VALUES (96, 5, 6, 'WR Drag', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (97, 5, 6, 'QB Slot Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (98, 5, 6, 'Smash Shake', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (99, 5, 6, 'QB Wrap', 'Run', 3, 2);
INSERT INTO `plays` VALUES (100, 4, 7, 'HB Weak', 'Run', 2, 1);
INSERT INTO `plays` VALUES (101, 4, 7, 'PA Rollout', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (102, 4, 7, 'FB Over', 'Run', 1, 1);
INSERT INTO `plays` VALUES (103, 4, 7, 'WR Curls', 'Pass', 5, 1);
INSERT INTO `plays` VALUES (104, 4, 7, 'HB Counter', 'Run', 12, 1);
INSERT INTO `plays` VALUES (105, 4, 7, 'Slot Cross', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (106, 4, 7, 'Slot Post', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (107, 4, 7, 'HB Smash', 'Run', 1, 1);
INSERT INTO `plays` VALUES (108, 4, 7, 'PA FB Streak', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (109, 4, 7, 'Short Posts', 'Pass', 5, 1);
INSERT INTO `plays` VALUES (110, 4, 7, 'Triple Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (111, 4, 7, 'Option Pass', 'Pass', 9, 2);
INSERT INTO `plays` VALUES (112, 4, 7, 'RB Corner', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (113, 4, 7, 'Power Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (114, 4, 7, 'WR Corner', 'Pass', 7, 1);
INSERT INTO `plays` VALUES (115, 4, 7, 'Hitch ''N Go', 'Pass', 8, 1);
INSERT INTO `plays` VALUES (116, 4, 7, 'HB Blast', 'Run', 1, 1);
INSERT INTO `plays` VALUES (117, 4, 7, 'WR Drag', 'Pass', 5, 1);
INSERT INTO `plays` VALUES (118, 1, 8, 'TE Wheel', 'Pass', 7, 1);
INSERT INTO `plays` VALUES (119, 1, 8, 'HB Slam', 'Run', 1, 1);
INSERT INTO `plays` VALUES (120, 1, 8, 'PA Rollout', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (121, 1, 8, 'Counter Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (122, 1, 8, 'TE Drag', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (123, 1, 8, 'HB Toss', 'Run', 2, 1);
INSERT INTO `plays` VALUES (124, 1, 8, 'Cross In', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (125, 1, 8, 'HB Dive', 'Run', 1, 1);
INSERT INTO `plays` VALUES (126, 1, 8, 'PA TE Crosses', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (127, 1, 8, 'Counter Trap', 'Run', 12, 1);
INSERT INTO `plays` VALUES (128, 1, 8, 'Corners', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (129, 1, 8, 'HB Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (130, 1, 8, 'TE Flag', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (131, 1, 8, 'HB Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (132, 1, 8, 'HB Screen', 'Pass', 10, 1);
INSERT INTO `plays` VALUES (133, 1, 8, 'HB Read', 'Run', 13, 1);
INSERT INTO `plays` VALUES (134, 1, 8, 'FL Post', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (135, 1, 8, 'HB Blast', 'Run', 1, 1);
INSERT INTO `plays` VALUES (136, 5, 9, 'Curl Flats', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (137, 5, 9, 'HB Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (138, 5, 9, 'PA WR In', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (139, 5, 9, 'Flood', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (140, 5, 9, 'HB Zone', 'Run', 13, 1);
INSERT INTO `plays` VALUES (141, 5, 9, 'Clearout Stop', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (142, 5, 9, 'Gambler', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (143, 5, 9, 'Zone Read', 'Run', 3, 2);
INSERT INTO `plays` VALUES (144, 5, 9, 'PA All Cross', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (145, 5, 9, 'HB Screen', 'Pass', 10, 0);
INSERT INTO `plays` VALUES (146, 5, 9, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (147, 5, 9, 'Trips Attack', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (148, 5, 9, 'WR Drag', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (149, 5, 9, 'Motion WR Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (150, 5, 9, 'Slants', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (151, 5, 9, 'In Out Combo', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (152, 5, 9, 'QB Wrap', 'Run', 3, 2);
INSERT INTO `plays` VALUES (153, 5, 9, 'Wheelie', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (154, 5, 10, 'Deep Strike', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (155, 5, 10, 'QB Choice', 'Run', 3, 2);
INSERT INTO `plays` VALUES (156, 5, 10, 'Slot Whips', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (157, 5, 10, 'Slot Crosses', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (158, 5, 10, 'HB Direct', 'Run', 2, 1);
INSERT INTO `plays` VALUES (159, 5, 10, 'Solo 7565', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (160, 5, 10, 'Slot Seams', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (161, 5, 10, 'Motion WR Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (162, 5, 10, 'Quick Slants', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (163, 5, 10, 'HB Screen', 'Pass', 10, 0);
INSERT INTO `plays` VALUES (164, 5, 10, 'QB Z Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (165, 5, 10, 'Scissors', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (166, 5, 10, 'SE Drag', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (167, 5, 10, 'HB Zone', 'Run', 13, 1);
INSERT INTO `plays` VALUES (168, 5, 10, 'PA Read', 'Pass', 9, 0);
INSERT INTO `plays` VALUES (169, 5, 10, 'Corner Strike', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (170, 5, 10, 'Inside Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (171, 5, 10, 'PA Flood', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (172, 5, 10, 'WR Short Posts', 'Pass', 5, 1);
INSERT INTO `plays` VALUES (173, 5, 10, 'Comeback Shake', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (174, 5, 10, 'WR Curls', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (175, 5, 10, 'HB Go', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (176, 5, 10, 'QB Power', 'Run', 1, 1);
INSERT INTO `plays` VALUES (177, 5, 10, 'SE Drive', 'Pass', 7, 1);
INSERT INTO `plays` VALUES (178, 5, 10, 'Slot Wheels', 'Pass', 8, 1);
INSERT INTO `plays` VALUES (179, 5, 10, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (180, 5, 10, 'Option Pass', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (181, 5, 11, 'Angle Post', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (182, 5, 11, 'HB Zone', 'Run', 13, 1);
INSERT INTO `plays` VALUES (183, 5, 11, 'PA Dagger', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (184, 5, 11, 'Corners', 'Pass', 7, 1);
INSERT INTO `plays` VALUES (185, 5, 11, 'QB Wrap', 'Run', 3, 2);
INSERT INTO `plays` VALUES (186, 5, 11, 'PA QB Choice', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (187, 5, 11, 'Drive', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (188, 5, 11, 'HB Direct', 'Run', 2, 1);
INSERT INTO `plays` VALUES (189, 5, 11, 'HB Screen', 'Pass', 10, 0);
INSERT INTO `plays` VALUES (190, 5, 11, 'Slot Cross', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (191, 5, 11, 'QB Slot Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (192, 5, 11, 'Slot Screen', 'Pass', 14, 1);
INSERT INTO `plays` VALUES (193, 5, 11, 'WR Drag', 'Pass', 5, 1);
INSERT INTO `plays` VALUES (194, 5, 11, 'Speed Option', 'Run', 3, 2);
INSERT INTO `plays` VALUES (195, 5, 11, 'Slot Corner', 'Pass', 6, 1);
INSERT INTO `plays` VALUES (196, 5, 11, 'Curl Flats', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (197, 5, 11, 'Motion WR Option', 'Run', 3, 3);
INSERT INTO `plays` VALUES (198, 5, 11, 'In Out Combo', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (199, 5, 11, 'Backside In', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (200, 5, 11, 'HB Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (201, 5, 11, 'PA WR In', 'Pass', 9, 1);
INSERT INTO `plays` VALUES (202, 5, 12, 'Curl Flats', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (203, 5, 12, 'QB Draw', 'Run', 4, 1);
INSERT INTO `plays` VALUES (204, 5, 12, 'Drive', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (205, 5, 12, 'Middle Attack', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (206, 5, 12, 'Middle Clear', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (207, 5, 12, 'Post Cross', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (208, 5, 12, 'Shallow Cross', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (209, 5, 12, 'Slot Hitches', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (210, 5, 12, 'SE Post', 'Pass', 7, 0);
INSERT INTO `plays` VALUES (211, 5, 12, 'Wheelies', 'Pass', 8, 0);
INSERT INTO `plays` VALUES (212, 5, 12, 'Quick Slants', 'Pass', 5, 0);
INSERT INTO `plays` VALUES (215, 5, 12, 'Whip Outs', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (216, 5, 12, 'Under Cross', 'Pass', 6, 0);
INSERT INTO `plays` VALUES (217, 5, 12, 'WR Screens', 'Pass', 14, 0);
INSERT INTO `plays` VALUES (218, 5, 12, 'Motion WR Option', 'Run', 3, 2);

-- --------------------------------------------------------

--
-- Table structure for table `sets`
--

CREATE TABLE `sets` (
  `set_id` int(10) unsigned NOT NULL auto_increment,
  `set` varchar(25) NOT NULL,
  `wr` int(1) NOT NULL,
  `te` int(1) NOT NULL,
  `rb` int(10) NOT NULL,
  PRIMARY KEY  (`set_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;

--
-- Dumping data for table `sets`
--

INSERT INTO `sets` VALUES (1, 'BIG BUNCH', 2, 2, 1);
INSERT INTO `sets` VALUES (2, 'TWINS FLEX', 2, 1, 2);
INSERT INTO `sets` VALUES (3, 'CLOSE', 2, 1, 2);
INSERT INTO `sets` VALUES (4, '2 BACK SLOT', 3, 0, 2);
INSERT INTO `sets` VALUES (5, 'BIG BUNCH STR', 2, 2, 1);
INSERT INTO `sets` VALUES (6, 'SLOT F TRIPS', 3, 0, 2);
INSERT INTO `sets` VALUES (7, 'SLOT', 3, 0, 2);
INSERT INTO `sets` VALUES (8, 'BIG WING TWINS', 2, 2, 1);
INSERT INTO `sets` VALUES (9, '4WR TRIO', 4, 0, 1);
INSERT INTO `sets` VALUES (10, 'SPREAD FLEX', 4, 0, 1);
INSERT INTO `sets` VALUES (11, '4WR TREY', 4, 0, 1);
INSERT INTO `sets` VALUES (12, '5WR TRIO', 5, 0, 0);[/code]

Link to comment
Share on other sites

just a guess, but <b>set</b> is a built-in MySQL function, so if you use ' then you are telingl MySQL not to use it as a function

[quote author=jdubwelch link=topic=118042.msg482022#msg482022 date=1165738047]
I have to use the ` around sets like this: `set` otherwise i get an error that says: [quote]#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set , plays . play_name  FROM plays  LEFT JOIN sets ON plays . set_id = sets . s' at line 1 [/quote]  Why is that?
[/quote]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.