[SOLVED] sql file problem

This is a discussion on "[SOLVED] sql file problem" within the Databases section. This forum, and the thread "[SOLVED] sql file problem are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 27th, 2007, 16:10
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] sql file problem

could anyone give me a working example of the sql file listed below, its just a simple sign up databases, that i would like to use a primary key with so records do not overwrite each other.

A working example would be great

CREATE DATABASE IF NOT EXISTS dbsignup;
USE dbsignup;
CREATE TABLE `customer_data`.`customer_details` (
`CUSTOMER_ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ;
`first_name` VARCHAR(30) NOT NULL ,
`last_name` VARCHAR(30) NOT NULL ,
`address` VARCHAR(70) NOT NULL ,
`city` VARCHAR(40) NOT NULL ,
`area` VARCHAR(50) NOT NULL ,
`email` VARCHAR(70) NOT NULL ,
`phone` VARCHAR(20) NOT NULL ,
`user_name` VARCHAR(30) NOT NULL ,
`password` VARCHAR(30) NOT NULL ,
`work_location` VARCHAR(60) NOT NULL ,
`agency_name` VARCHAR(70) NOT NULL ,
`agency_number` VARCHAR(30) NOT NULL ,
`skills` VARCHAR(500) NOT NULL ,
`about_me` VARCHAR(500) NOT NULL ,
`myspace_address` VARCHAR(50) NOT NULL ,
`hotmail_yahoo_address VARCHAR(50) NOT NULL ,
`gender` VARCHAR(10) NOT NULL ,
`age` VARCHAR(3) NOT NULL ,
`height` VARCHAR(20) NOT NULL ,
`build` VARCHAR(20) NOT NULL ,
`eye_colour` VARCHAR(20) NOT NULL ,
`hair_colour` VARCHAR(30) NOT NULL ,
`desired_work` VARCHAR(100) NOT NULL ,
`image_one` VARCHAR(10) NOT NULL ,
`image_two` VARCHAR(10) NOT NULL ,
`image_three` VARCHAR(10) NOT NULL ,
`image_four` VARCHAR(10) NOT NULL ,
) ENGINE = MYISAM


Reply With Quote

  #2 (permalink)  
Old Oct 27th, 2007, 17:09
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
Re: sql file problem

I have solved my problem

For anyone stuck on how to create a table using auto increment look below:

It works 100%

CREATE DATABASE IF NOT EXISTS dbsignup;
USE dbsignup;
CREATE TABLE `customer` (`customer_id` INT( 3 ) NOT NULL
AUTO_INCREMENT,
`first_name` VARCHAR(30) NOT NULL ,
`last_name` VARCHAR(30) NOT NULL ,
`address` VARCHAR(70) NOT NULL ,
`city` VARCHAR(40) NOT NULL ,
`area` VARCHAR(50) NOT NULL ,
`email` VARCHAR(70) NOT NULL ,
`phone` VARCHAR(20) NOT NULL ,
`user_name` VARCHAR(30) NOT NULL ,
`password` VARCHAR(30) NOT NULL ,
`work_location` VARCHAR(60) NOT NULL ,
`agency_name` VARCHAR(70) NOT NULL ,
`agency_number` VARCHAR(30) NOT NULL ,
`skills` VARCHAR(500) NOT NULL ,
`about_me` VARCHAR(500) NOT NULL ,
`myspace_address` VARCHAR(50) NOT NULL ,
`hotmail_yahoo_address` VARCHAR(50) NOT NULL ,
`gender` VARCHAR(10) NOT NULL ,
`age` VARCHAR(3) NOT NULL ,
`height` VARCHAR(20) NOT NULL ,
`build` VARCHAR(20) NOT NULL ,
`eye_colour` VARCHAR(20) NOT NULL ,
`hair_colour` VARCHAR(30) NOT NULL ,
`desired_work` VARCHAR(100) NOT NULL ,
`image_one` VARCHAR(10) NOT NULL ,
`image_two` VARCHAR(10) NOT NULL ,
`image_three` VARCHAR(10) NOT NULL ,
`image_four` VARCHAR(10) NOT NULL , UNIQUE ( `customer_id` ) );
Reply With Quote
Reply

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 On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PHP File Upload Stuart PHP Forum 10 Nov 26th, 2007 23:01
[SOLVED] getting page file name. KillerChutney PHP Forum 6 Nov 12th, 2007 16:17
[SOLVED] writing a config file saltedm8 PHP Forum 2 Oct 13th, 2007 18:31
File upload problem scoper ASP.NET Forum 0 Oct 10th, 2006 02:34
file access problem Colm Osiris PHP Forum 2 Jun 5th, 2006 08:22


All times are GMT. The time now is 06:30.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43