Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1; From databases to forms: read the states from a database table instead of putting them into a PHP array yourself.(the php file is

Part 1; From databases to forms: read the states from a database table instead of putting them into a PHP array yourself.(the php file is included down below)

The database is named weblab and the table of states is named state_t. The table was created as follows:

CREATE TABLE state_t ( state_abbr char(2) PRIMARY KEY, state_name char(20), state_zone integer); 

Display the state name in the drop-down, but transmit the state abbreviation through the form. You do this by using a value attribute on the

element. The form area for State will look something like the following. Of course, you have to build this using PHP, and not just type it in.

AlabamaFloridaGeorgiaTennessee 

You will not use the state_zone attribute. In "real life" it would be used for calculating shipping, maybe.

Present the state names in alphabetical order on your form. The easy way to do this is to have the database management system sort them for you using an ORDER BY clause in your SQL. For those of you who took Database long ago and far away (or not at all!), a suitable query for populating the array is this:

SELECT state_abbr, state_name from state_t ORDER BY state_name; 

this is my php file

My Form

Order

Product quantity wanted

Product Price Quantity
crescent_wrench $15
spanners $10
monkey_wrench $12

Customer infromation:

payement methods:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions