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 > new to mySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-06, 22:10
Durendal420 Durendal420 is offline
Registered User
 
Join Date: Nov 2006
Location: Saskatoon, Saskatchewan, Canada
Posts: 2
Question new to mySQL

hey guys im just learning php and mySQL right now so this will sound really noobish but ive been trying to setup a table in my database in phpmyadmin i clicked on the little php tag under the phpmyadmin logo and entered the following code in the window that opened:

CREATE TABLE meminfo (name VARCHAR, email VARCHAR, phone INT, adress FLOAT, comments VARCHAR);

after that it gives me this error:

#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 ' email VARCHAR, phone INT, adress FLOAT, comments VARCHAR)' at line 1

im sure its probably a small syntax error or something but im hoping more experienced eyes might help me pick it out ive looked through it several times and cant seem to find whats wrong. my server runs MySQL client version: 4.1.10

thanks for your time

Reguards,
Durendal420

Last edited by Durendal420; 11-19-06 at 22:16.
Reply With Quote
  #2 (permalink)  
Old 11-19-06, 22:37
dbmab dbmab is offline
Registered User
 
Join Date: Apr 2006
Location: Denver, Co. USA
Posts: 240
For VARCHAR data type you must specify a maximum size - try something like - VARCHAR(255)
Reply With Quote
  #3 (permalink)  
Old 11-19-06, 22:42
Durendal420 Durendal420 is offline
Registered User
 
Join Date: Nov 2006
Location: Saskatoon, Saskatchewan, Canada
Posts: 2
works great thanks a lot

Reguards,
Durendal420
Reply With Quote
  #4 (permalink)  
Old 11-19-06, 23:10
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
adress FLOAT?????
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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