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.
|
|
|
|
|
![]() |
||
[SOLVED] sql file problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[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 |
|
|
|
#2
|
|||
|
|||
|
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` ) ); |
![]() |
| Thread Tools | |
|
|
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 |