Jump to content

Recommended Posts

Hi,

 

I'm trying to get my Dreamweaver setup for the first time to be able to develop dynamic sites directly on my remote hosted webserver. I've been following the Dreamweaver instructions and I've gotten to the point where my site "MySampleapp" is defined and I can PUT and GET my files from my remote ftp server into Dreamweaver. Now comes the part where Dreamweaver instructions say to drop the insert.sql file into mysql/bin and then follow a series of command line instructions, but obviously I can't do that on the remote server.

 

Is there a way I can get that database info in insert.sql to install automatically another way? like through some php script?

 

The insert.sql file looks like this:

 

#

# Table structure for table `comments`

#

 

CREATE TABLE comments (

COMMENT_ID int(11) NOT NULL auto_increment,

FIRST_NAME varchar(50) default NULL,

LAST_NAME varchar(50) default NULL,

TELEPHONE varchar(20) default NULL,

EMAIL varchar(50) default NULL,

SUBMIT_DATE datetime default NULL,

COMMENTS longtext,

ANSWERED tinyint(4) default NULL,

PRIMARY KEY (COMMENT_ID),

KEY PRIMARY_KEY (COMMENT_ID)

) TYPE=MyISAM;

 

#

# Dumping data for table `comments`

#

 

INSERT INTO comments (COMMENT_ID, FIRST_NAME, LAST_NAME, TELEPHONE, EMAIL, SUBMIT_DATE, COMMENTS, ANSWERED) VALUES (1, 'Letitia', 'Riley', '210-651-0964', 'letitiariley@juno.com', '2002-02-13 00:00:00', 'Are there any plans to put a facility in Anchorage Alaska?', 1);

INSERT INTO comments (COMMENT_ID, FIRST_NAME, LAST_NAME, TELEPHONE, EMAIL, SUBMIT_DATE, COMMENTS, ANSWERED) VALUES (2, 'Sachiko', 'Matsuda', '(0) 476 322 802', 'sachi@web.net', '2002-03-20 00:00:00', 'Unbelievably excellent service received at your New Tokyo airport facility.', 0);

INSERT INTO comments (COMMENT_ID, FIRST_NAME, LAST_NAME, TELEPHONE, EMAIL, SUBMIT_DATE, COMMENTS, ANSWERED) VALUES (3, 'Dieter', 'Dietrich', '', 'dd@worldly.com', '2002-03-24 00:00:00', 'Does your Heathrow office lease automobiles?', 0);

# --------------------------------------------------------

 

#

# Table structure for table `locations`

#

 

CREATE TABLE locations (

CODE char(4) NOT NULL default '',

LOCATION_NAME char(100) default NULL,

ADDRESS char(50) default NULL,

CITY char(50) default NULL,

STATE_COUNTRY char(50) default NULL,

REGION_ID int(11) NOT NULL default '0',

TELEPHONE char(20) default NULL,

FAX char(20) default NULL,

PRIMARY KEY (CODE),

KEY code (CODE),

KEY REGION_ID (REGION_ID)

) TYPE=MyISAM;

 

#

# Dumping data for table `locations`

#

 

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('BWI', 'Baltimore-Washington International', 'Airport Blvd', 'Baltimore', 'MD', 1, '410-121-1222', '410-121-1223');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('CAI', 'Cairo International Airport', 'Cairo International Airport', 'Cairo', 'Egypt', 4, '2022652432', '2022652433');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('CBR', 'Canberra', 'Canberra Airport', 'Canberra', 'Australia', 6, '02 62496211', '02 62496212');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('CNS', 'Cairns', 'Cairns Airport', 'Cairns', 'Queensland', 6, '07 40359300', '07 40359300');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('CPT', 'Cape Town Airport', 'Cape Town Airport', 'Cape Town', 'South Africa', 4, '0272 19 343914', '0272 19 343915');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('CWB', 'Afonso Pena', 'Av. N. Sra Da Aparecida 904', 'Curitiba', 'Brazil', 2, '55 412698 010', '55 412698 011');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('CZM', 'Aeropuerto Intl De Cozumel', 'Cozumel Airport', 'Cozumel', 'Mexico', 2, '5298723888', '5298723889');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('DEN', 'Denver International', '100 Pena Blvd', 'Denver', 'CO', 1, '303-667-6555', '303-667-6556');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('DFW', 'Dallas Ft Worth International', '3838 North Bound Service Road', 'Dallas/Ft Worth', 'TX', 1, '972-455-3333', '972-455-3334');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('EZE', 'Eze', 'Autopista Tte Ricchierei', 'Buenos Aires', 'Argentina', 2, '00-54-4480-0055', '00-54-4480-0056');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('FRA', 'Frankfurt Airport', 'General Aviation Terminal - Frankfurt Airport', 'Frankfurt', 'Germany', 3, '069 69593245', '069 69593246');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('KIX', 'Kansai International Airport', 'Senshu-kuko Kita', 'Osaka', 'Japan', 5, '(0)724 552 500', '(0)724 552 500');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('LHR', 'Heathrow Airport', 'Heathrow Airport', 'London', 'United Kingdom', 3, '020 88972075', '020 88972074');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('MCI', 'Kansas City International Airport', '902 Tel Aviv Ave', 'Kansas City', 'MO', 1, '816-243-5765', '816-243-5591');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('MSP', 'Minneapolis/St Paul Intl Airport', '4300 Glumack Drive', 'Minneapolis', 'MN', 1, '651-698-9585', '651-698-3062');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('MUC', 'Franz-Josef-Strauss Airport', 'Franz-Josef-Strauss Airport', 'Munich', 'Germany', 3, '089 978861', '089 978865');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('NRT', 'New Tokyo International Airport', 'Chiba 282-8601', 'Narita', 'Japan', 5, '(0)476 322 802', '(0)476 322 802');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('PMO', 'Punta Raisi', 'Punta Raisi Airport - Sicily', 'Palermo', 'Sicily', 3, '091 213 113', '091 213 113');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('PNA', 'Noain', 'Airport', 'Pamplona', 'Spain', 3, '948 311596', '948 311596');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('SIN', 'Singapore Changi Airport', 'Singapore Changi Airport', 'Singapore', 'Singapore', 5, '(65)542-5300', '(65)542-5301');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('TPS', 'Vincenzo-Florio Airport', 'Vincenzo-Florio Airport', 'Trapani', 'Italy', 3, '0923 842666', '0923 842667');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('YGK', 'Kingston Airport', '676 Princess St.', 'Kingston', 'Ontario', 1, '613-531-2145', '613-531-2146');

INSERT INTO locations (CODE, LOCATION_NAME, ADDRESS, CITY, STATE_COUNTRY, REGION_ID, TELEPHONE, FAX) VALUES ('YQG', 'Windsor International', 'Windsor Airport', 'Windsor', 'Ontario', 1, '519-250-3455', '519-250-3456');

# --------------------------------------------------------

 

#

# Table structure for table `region`

#

 

CREATE TABLE region (

ID int(11) NOT NULL auto_increment,

NAME char(50) default NULL,

PRIMARY KEY (ID)

) TYPE=MyISAM;

 

#

# Dumping data for table `region`

#

 

INSERT INTO region (ID, NAME) VALUES (1, 'North America');

INSERT INTO region (ID, NAME) VALUES (2, 'South/Central America');

INSERT INTO region (ID, NAME) VALUES (3, 'Europe');

INSERT INTO region (ID, NAME) VALUES (4, 'Africa');

INSERT INTO region (ID, NAME) VALUES (5, 'Asia');

INSERT INTO region (ID, NAME) VALUES (6, 'Australia');

 

 

and these are the instructions I'm following in Dreamweaver:

 

Creating the MySQL database

During installation, Dreamweaver MX copies a SQL script capable of creating and populating a sample MySQL database.

 

Before starting, make sure MySQL is installed and configured on your local or remote computer. You can download the latest version from the MySQL website.

 

To create the sample MySQL database:

Copy the SQL script file, insert.sql, to the MySql\Bin folder on the computer with MySQL.

The script file is located in the following folder on your hard disk:

 

\Macromedia\Dreamweaver MX\Samples\Database\insert.sql

 

On the computer with MySQL, open the command prompt window.

In Windows, you can open the command prompt by selecting Start > Programs > Command Prompt.

 

Note: On some systems, the Command Prompt may be located under Accessories in the Start > Programs menu.

 

Change to the mysql\bin directory by entering the following commands at the command prompt:

> cd\

> cd mysql\bin

Launch the MySQL client by entering the following command at the mysql\bin\ prompt:

> mysql -uUser -pPassword

 

For example, if your MySQL user name (also known as an account name) and password are Tara and Telly3, then enter the following command:

 

> mysql -uTara -pTelly3

 

If you don’t have a password, omit the -p argument as follows:

 

> mysql -uTara

 

If you didn’t define a user name while configuring your MySQL installation, enter root as the user name, as follows:

 

> mysql -uroot

 

The MySQL client’s command prompt appears, as follows:

 

mysql>

Create a new database by entering the following command at the MySQL prompt:

mysql>CREATE DATABASE GlobalCar;

 

MySQL creates a new database, but it doesn’t contain any tables or records yet.

 

Log out of the MySQL client by entering the following command at the prompt:

mysql>quit

At the system command prompt, populate the new GlobalCar database in MySQL with the following command:

> mysql -uUser -pPassword GlobalCar < insert.sql

 

This command uses the insert.sql file to add tables and records to the GlobalCar database you created in step 5.

 

After creating the MySQL database, create a database connection to it in Dreamweaver. See Creating a database connection.

 

If someone knows the way around this so I can continue moving forward please let me know. Or is something I should just do manually through phpadmin or something?

Link to comment
https://forums.phpfreaks.com/topic/2002-setting-up-dreamweaver-for-remote-site/
Share on other sites

Thanks for your answer. OK, so I am now entering the data manually and I've got something I don't get. It has to do with the (COMMENT_ID) description for the PRIMARY KEY variable:

 

phpmascreen001.jpg

 

It comes from this part of the insert.sql code:

 

CREATE TABLE comments (

COMMENT_ID int(11) NOT NULL auto_increment,

FIRST_NAME varchar(50) default NULL,

LAST_NAME varchar(50) default NULL,

TELEPHONE varchar(20) default NULL,

EMAIL varchar(50) default NULL,

SUBMIT_DATE datetime default NULL,

COMMENTS longtext,

ANSWERED tinyint(4) default NULL,

PRIMARY KEY (COMMENT_ID),

KEY PRIMARY_KEY (COMMENT_ID)

) TYPE=MyISAM;

 

 

I think the Dreamweaver intention is that these two last variables match the integer of the COMMENT_ID variable. What do I need to put into these fields to make this happen?

  • 1 month later...

I use Dreamweaver also to program my sites, but I think an easier way to achieve this would be this....

 

Goto your phpMyAdmin - select your appropriate database name, then in the SQL query window paste the contents of your insert.sql file which in this case is the following,

 

CREATE TABLE comments (

COMMENT_ID int(11) NOT NULL auto_increment,

FIRST_NAME varchar(50) default NULL,

LAST_NAME varchar(50) default NULL,

TELEPHONE varchar(20) default NULL,

EMAIL varchar(50) default NULL,

SUBMIT_DATE datetime default NULL,

COMMENTS longtext,

ANSWERED tinyint(4) default NULL,

PRIMARY KEY (COMMENT_ID),

KEY PRIMARY_KEY (COMMENT_ID)

)

 

Press GO!

 

and there you have it! the table "comments" will now be created for you with all the appropriate properties, i.e. varchar, int, longtext, etc...

 

Thats the way I create my tables....

 

Surely though you could write your own script for creating tables from a web-form located locally on your workstation.

 

Hope that helps.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.