General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Laplink Gold 2008 - $15 Off with Coupon Code CJM9NE
  #1  
Old May 30th, 2002, 08:21 PM
arthurparker arthurparker is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 13 arthurparker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
this is too complicated

I am really irritated right now. I am try to create a table called users, with these fields - options:
- UserID - auto increment and is unique and the primary
- Email - indexed
- Password
- FirstName
- LastName
- Company
- Address1
- Address2
- City
- State
- ZipCode
- Country
- HomePhoneArea
- HomePhone
- WorkPhoneArea
- WorkPhone
- FaxNumberArea
- FaxNumber
- Verified

i used this query:

mysql> use database;
Database changed <-- Program added
mysql> create table users
-> (
-> UserID int(7) not null auto_increment,
-> Email text(100) not null,
-> Password text(25) not null,
-> FirstName text(25) not null,
-> LastName text(25) not null,
-> Company text(100),
-> Address1 text(100) not null,
-> Address2 text(100),
-> City text(50),
-> State text(2) not null,
-> ZipCode text(5) not null,
-> Country text(100) not null,
-> HomePhoneArea text(3) not null,
-> HomePhone text(7) not null,
-> WorkPhoneArea text(3) not null,
-> WorkPhone text(7) not null,
-> FaxNumberArea text(3) not null,
-> FaxNumber text(7) not null,
-> Verified int(1) default '0'
-> );


And i got this error:
ERROR 1064: You have an error in your SQL syntax near '(100) not null,
Password text(25) not null,
FirstName text(25) not null,
LastNam' at line 4
mysql>


PLEASE HELP ME!!!!!!!!!! I WILL NOT FORGET IT!!!!!!!!!!
AP

Reply With Quote
  #2  
Old May 30th, 2002, 10:07 PM
CopeLand CopeLand is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Toronto
Posts: 40 CopeLand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hey Arthur,
Firstly, you need to define UserId as a primary key and unique identiifer. Secondly, you should use varchar (variable character) instead of text, coz text is too big.

Anyway, I made some changes and here's the working MySQL code:

create table users
(
UserID int auto_increment not null,
Email varchar(100) not null,
Password varchar(25) not null,
FirstName varchar(25) not null,
LastName varchar(25) not null,
Company varchar(100),
Address1 varchar(100) not null,
Address2 varchar(100),
City varchar(50),
State char(2) not null,
ZipCode char(5) not null,
Country varchar(100) not null,
HomePhoneArea varchar(3) not null,
HomePhone varchar(7) not null,
WorkPhoneArea varchar(3) not null,
WorkPhone varchar(7) not null,
FaxNumberArea varchar(3) not null,
FaxNumber varchar(7) not null,
Verified tinyint default 0,

primary key(UserID),
unique id(UserID)
);
__________________
i am cope. i drink coke. i am in hope.i am cope. i drink coke. i am in hope.i am cope. i drink coke. i am in hope.

Reply With Quote
  #3  
Old May 30th, 2002, 10:12 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
ok ok, take 2 deep breaths, we feeling a bit better now?? ok, now to your problem

first point, you should only use lower_case, for your field names, ive had problems before with caps on

when you have text i dont think you can give a field lenght, change all the text fields to varchar,

try this

create table users (
user_id tinyint(7) not null auto_increment,
email varchar(100) not null,
password varchar(25) not null,
firstname varchar(25) not null,
lastname varchar(25) not null,
company varchar(100),
address1 varchar(100) not null,
address2 varchar(100),
city varchar(50),
state varchar(2) not null,
zipcode tinyint(5) not null,
country varchar(100) not null,
homephonearea tinyint(3) not null,
homephone varchar(7) not null,
workphonearea tinyint(3) not null,
workphone varchar(7) not null,
faxnumberarea tinyint(3) not null,
faxnumber varchar(7) not null,
verified int(1) default '0' );

just a few things, i made the phone numbers varchar's incase they add a - between the numbers

let me know if that works?? i cant test it cos im at work, but once i get home, if your still having problems with it reply with the error msg, and id be happy to help

Reply With Quote
  #4  
Old May 30th, 2002, 10:18 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
copeland we gotta stop answering questions at the same time, lol oh yeah i did forget to mention the primary and unique keys,

arthurparker with all this information you should be able to get your table working.'

Reply With Quote
  #5  
Old May 31st, 2002, 09:38 AM
arthurparker arthurparker is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 13 arthurparker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink thank you

thanks ben and copeland.

i tried both and they both work.

Thank you so much.

AP

Reply With Quote
  #6  
Old May 31st, 2002, 09:44 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
np, anytime, theirs nothing to big or small (i think) that we cant handle [evil laugh]ahahahahah[/evil laugh]

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > this is too complicated


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway