Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
A failed string of text for MySQL
Old 07-07-2008, 12:07 PM A failed string of text for MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
I try to dump this in to MySQL...

Code:
CREATE TABLE affiliates (
  affID int(3)  DEFAULT '' NOT NULL auto_increment,
  refid varchar(30)  DEFAULT '' NOT NULL ,
  pass varchar(20)  DEFAULT '' NOT NULL ,
  company varchar(100)  DEFAULT '' NOT NULL ,
  title varchar(5)  DEFAULT '' NOT NULL ,
  firstname varchar(40)  DEFAULT '' NOT NULL ,
  lastname varchar(40)  DEFAULT '' NOT NULL ,
  website varchar(100)  DEFAULT '' NOT NULL ,
  email varchar(100)  DEFAULT '' NOT NULL ,
  payableto varchar(100)  DEFAULT '' NOT NULL ,
  street varchar(100)  DEFAULT '' NOT NULL ,
  town varchar(100)  DEFAULT '' NOT NULL ,
  county varchar(100)  DEFAULT '' NOT NULL ,
  postcode varchar(20)  DEFAULT '' NOT NULL ,
  country varchar(100)  DEFAULT '' NOT NULL ,
  phone varchar(30)  DEFAULT '' NOT NULL ,
  fax varchar(30)  DEFAULT '' NOT NULL ,
  date varchar(40)  DEFAULT '' NOT NULL ,
  PRIMARY KEY (affID)
);
 
INSERT  INTO affiliates  VALUES('1','testAff','testAff','testAff','Mr','testAff','testAff','testAff','','testAff','testAff','testAff','testAff','testAff','US','testAff','testAff','');
INSERT  INTO affiliates  VALUES('2','testAff1','testAff1','testAff1','Mr','testAff','testAff','','tester@hotmail.com','testAff','testAff','testAff','testAff','testAff','US','testAff','testAff','');
And it says that the first line, "affID int(3) DEFAULT '' NOT NULL auto_increment,"

is not a valid way to write that string of text, rejecting my entry.

I'm a beginner, and have no way of knowing why this would be so: Perhaps you can tell me?
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-07-2008, 08:30 PM Re: A failed string of text for MySQL
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Lose the default value defined in the primary field (affID). This is an auto incremented field, there should not be a default value defined.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-08-2008, 02:48 AM Re: A failed string of text for MySQL
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I always create my DB tables using PHPMyAdmin and then copy the code. Very easy and reduces errors.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-08-2008, 10:34 AM Re: A failed string of text for MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
Thanks, I will try that
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 07-08-2008, 10:54 AM Re: A failed string of text for MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
I tried putting this into my database:

affID int(3) '' NOT NULL auto_increment,

still got an error.

I've just heard of PHPmyAdmin, so I will be looking into getting that program as well.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 07-08-2008, 10:55 AM Re: A failed string of text for MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
i've been inserting all my tables manually for a little while now, so it'd be cool to actually use an editor to let me know when I mess up.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to A failed string of text for MySQL
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16722 seconds with 12 queries