There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 boot bsod computer cpu crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware help please hijackthis hjt hjt log install internet internet explorer itunes javascript keyboard lan laptop log malware monitor network networking outlook outlook 2003 outlook express password php popups problem router seo slow sound sp3 spyware startup trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless youtube
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
mySQL Coding Help


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Scarface23's Avatar
Member with 45 posts.
 
Join Date: Aug 2004
Experience: Intermediate
29-Apr-2008, 10:40 PM #1
mySQL Coding Help
Hi guys, Im having a problem of getting this database to work.
Heres The Ouput im receiving when trying to use the database:

ERROR 1064 (42000) at line 55: 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 'Players'
--
INSERT INTO Players VALUES (1, 1, 'Erik', 'Bird', 'RHP', 1, 74, ' at line 9

And Here is the section of code around the area of the error:

CREATE TABLE Players (
PlayerID int(2) NOT NULL default '0',
TeamID int(1) NOT NULL,
PlayerFirstName varchar(30) NOT NULL default '',
PlayerLastName varchar(30) NOT NULL default '',
PlayerPosition varchar(3) NOT NULL default '',
PlayerNumber int(2) NOT NULL default '0',
PlayerHeight int(3) NOT NULL default '0',
PlayerWeight int(3) NOT NULL default '0,
PlayerBatThrow varchar(4) NOT NULL default '',
PlayerClass varchar(2) NOT NULL default '',
PRIMARY KEY (PlayerID,TeamID)
) TYPE=MyISAM;

--
-- Dumping data for table 'Players'
--

INSERT INTO Players VALUES (1, 1, 'Erik', 'Bird', 'RHP', 1, 74, 215, 'R/R', 'Fr');
INSERT INTO Players VALUES (2,1,'Andrew', 'Brown', '1B', 2, 72, 195, 'R/R', 'Jr');
INSERT INTO Players VALUES (3,1,'Brandon', 'Buckman', '2B', 3, 77, 225, 'L/L', 'Sr');
INSERT INTO Players VALUES (4,1,'Joba', 'Chamberlain', 'RHP', 4, 75, 225, 'R/R', 'Jr');
Chicon's Avatar
Computer Specs
Distinguished Member with 6,369 posts.
 
Join Date: Jul 2004
Location: 50° 34' 07.13" N - 04° 10' 23.
Experience: Second socks retriever
30-Apr-2008, 05:17 AM #2
Hi Scarface23,

This should work :

INSERT INTO Players VALUES ( '1', '1', 'Erik', 'Bird', 'RHP', '1', '74', '215', 'R/R', 'Fr' );

It may look weird but numeric values must be enclosed with quotes too !
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:18 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.