If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Having some trouble with Create Table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-15-10, 01:29
NeoTechni NeoTechni is offline
Registered User
 
Join Date: Jun 2010
Posts: 4
Having some trouble with Create Table

It tells me something is wrong with my syntax, but oh so helpfully doesn't tell me what is wrong.

CREATE TABLE 'Friends'
(Name TINYTEXT,
Phone CHAR(10))
Reply With Quote
  #2 (permalink)  
Old 06-15-10, 01:42
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Remove the single quotes around Friends:
Code:
CREATE TABLE friends
(
  name tinytext,
  phone char(10)
);
It also might be that "name" is a reserved word, so you want to check that in the manual
Reply With Quote
  #3 (permalink)  
Old 06-15-10, 02:04
NeoTechni NeoTechni is offline
Registered User
 
Join Date: Jun 2010
Posts: 4
I added code to auto-error if it detects any reserved keywords or spaces in names, it didnt find any.
I removed the single quotes

I think that did it.

EDIT: I forgot to thank you, thank you by the way.
I am now 2 steps farther into MySQL than I got with MS's BS (couldn't even connect to it)
Reply With Quote
  #4 (permalink)  
Old 06-15-10, 02:39
don_log don_log is offline
Registered User
 
Join Date: Jun 2008
Location: pakistan
Posts: 109
but why you want tiny text get varchar data type
Reply With Quote
  #5 (permalink)  
Old 06-15-10, 02:40
NeoTechni NeoTechni is offline
Registered User
 
Join Date: Jun 2010
Posts: 4
Just testing/learning
Reply With Quote
  #6 (permalink)  
Old 06-20-10, 08:14
svetco svetco is offline
Registered User
 
Join Date: Jun 2010
Posts: 2
Other options

Why don't you try using NaviCat or other MySQL visual interface.
Reply With Quote
  #7 (permalink)  
Old 06-20-10, 08:54
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by svetco View Post
Why don't you try using NaviCat or other MySQL visual interface.
why?

because learning SQL is better, that's why

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #8 (permalink)  
Old 06-20-10, 14:02
NeoTechni NeoTechni is offline
Registered User
 
Join Date: Jun 2010
Posts: 4
Quote:
Originally Posted by r937 View Post
why?

because learning SQL is better, that's why

Exactly. I'm trying to get a job for this.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On