Hello TJ1,
That is an easy thing, just go to the Patch SQL Install and issue a couple commands.
First, we will start with a simple command,
SHOW DATABASES;
This tells us the database name that we will use. Next, issue the
SHOW TABLES FROM db_name;
We use the database name(s) returned from the SHOW DATABASE command in place of db_name in the above command. This lets us see if there is a prefix that we need to use.
Next, we use the CREATE TABLE like the following, what I lifted from the address book part of ZC:
DROP TABLE IF EXISTS "zencart"."zc1_address_book";
CREATE TABLE "zencart"."zc1_address_book" (
"address_book_id" int(11) NOT NULL auto_increment,
"customers_id" int(11) NOT NULL default '0',
"entry_gender" char(1) NOT NULL default '',
"entry_company" varchar(32) default NULL,
"entry_firstname" varchar(32) NOT NULL default '',
"entry_lastname" varchar(32) NOT NULL default '',
"entry_street_address" varchar(64) NOT NULL default '',
"entry_suburb" varchar(32) default NULL,
"entry_postcode" varchar(10) NOT NULL default '',
"entry_city" varchar(32) NOT NULL default '',
"entry_state" varchar(32) default NULL,
"entry_country_id" int(11) NOT NULL default '0',
"entry_zone_id" int(11) NOT NULL default '0',
PRIMARY KEY ("address_book_id"),
KEY "idx_address_book_customers_id_zen" ("customers_id")
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```Things to note: 1) CREATE TABLE "zencart"."zc1_address_book" means create the table zc1_address_book in the database zencart. In this case I am using the prefix zc1_ so we would use that in creating a new table. 2) I don't know if you need a crash course in MySQL syntext or not, yet I'll cover a couple basic things. For more info you can go to [http://mysql.org](http://mysql.org/). 3) int(11) means an integer value extending to 11 places left of the decimal point, while varchar means up to 32 charters in the field. 4) PRIMARY KEY ("address_book_id") indicates what field will be the primary key, while it shows a second key being created called "idx_address_book_customers_id_zen" that is based on the field customers_id.
The easy part is done. Now you have to insert the needed code in the correct pages in the correct areas, with the correct fields to be displayed and for data entry.
Just some questions to ask yourself:
A) What fields do you need in the table?
B) What type of fields - decimal, charter, integer, text, blob, etc, and how much information will be contained in each field.
C) What areas do you need the info displayed in? Is is just for the administrator, the administrator and customer?
D) Will you use the new data in calculations, and if so, how? Do you have any test data where you already know the answers to that you can use to test the new code with?
Good luck with your project.